| OLD | NEW |
| 1 // Copyright 2017 The LUCI Authors. All rights reserved. | 1 // Copyright 2017 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
| 4 | 4 |
| 5 package spec | 5 package spec |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "crypto/sha256" | 8 "crypto/sha256" |
| 9 "encoding/hex" | 9 "encoding/hex" |
| 10 "fmt" | 10 "fmt" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 func (s specPackageSlice) Len() int { return len(s) } | 95 func (s specPackageSlice) Len() int { return len(s) } |
| 96 func (s specPackageSlice) Swap(i, j int) { s[i], s[j] = s[j], s[i] } | 96 func (s specPackageSlice) Swap(i, j int) { s[i], s[j] = s[j], s[i] } |
| 97 | 97 |
| 98 func (s specPackageSlice) Less(i, j int) bool { | 98 func (s specPackageSlice) Less(i, j int) bool { |
| 99 return sortby.Chain{ | 99 return sortby.Chain{ |
| 100 func(i, j int) bool { return s[i].Name < s[j].Name }, | 100 func(i, j int) bool { return s[i].Name < s[j].Name }, |
| 101 func(i, j int) bool { return s[i].Version < s[j].Version }, | 101 func(i, j int) bool { return s[i].Version < s[j].Version }, |
| 102 }.Use(i, j) | 102 }.Use(i, j) |
| 103 } | 103 } |
| 104 | 104 |
| 105 type pep425TagSlice []*vpython.Pep425Tag | 105 type pep425TagSlice []*vpython.PEP425Tag |
| 106 | 106 |
| 107 func (s pep425TagSlice) Len() int { return len(s) } | 107 func (s pep425TagSlice) Len() int { return len(s) } |
| 108 func (s pep425TagSlice) Swap(i, j int) { s[i], s[j] = s[j], s[i] } | 108 func (s pep425TagSlice) Swap(i, j int) { s[i], s[j] = s[j], s[i] } |
| 109 | 109 |
| 110 func (s pep425TagSlice) Less(i, j int) bool { | 110 func (s pep425TagSlice) Less(i, j int) bool { |
| 111 return sortby.Chain{ | 111 return sortby.Chain{ |
| 112 » » func(i, j int) bool { return s[i].Version < s[j].Version }, | 112 » » func(i, j int) bool { return s[i].Python < s[j].Python }, |
| 113 func(i, j int) bool { return s[i].Abi < s[j].Abi }, | 113 func(i, j int) bool { return s[i].Abi < s[j].Abi }, |
| 114 » » func(i, j int) bool { return s[i].Arch < s[j].Arch }, | 114 » » func(i, j int) bool { return s[i].Platform < s[j].Platform }, |
| 115 }.Use(i, j) | 115 }.Use(i, j) |
| 116 } | 116 } |
| OLD | NEW |