Skip to content

Commit 7515d24

Browse files
Zxillyalexandear
andauthored
fix: scrape all goos/goarch pair for stdlib (#208)
* fix: scrape all goos/goarch pair for stdlib Signed-off-by: Zxilly <[email protected]> * perf: init pkgs with size Co-authored-by: Oleksandr Redko <[email protected]> Signed-off-by: Zxilly <[email protected]> * feat: use errgroup instead Signed-off-by: Zxilly <[email protected]> * chore: simplify string compare Co-authored-by: Oleksandr Redko <[email protected]> Signed-off-by: Zxilly <[email protected]> * fix: update import Signed-off-by: Zxilly <[email protected]> * chore: use strings.Cut Co-authored-by: Oleksandr Redko <[email protected]> Signed-off-by: Zxilly <[email protected]> Co-authored-by: Oleksandr Redko <[email protected]> Signed-off-by: Zxilly <[email protected]> --------- Signed-off-by: Zxilly <[email protected]> Co-authored-by: Oleksandr Redko <[email protected]>
1 parent 2b6d5ac commit 7515d24

File tree

4 files changed

+95
-7
lines changed

4 files changed

+95
-7
lines changed

internal/generate.go

Lines changed: 91 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/config/config.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package config
22

33
import (
44
"sort"
5-
"strings"
65

76
"gopkg.in/yaml.v3"
87

@@ -64,11 +63,11 @@ func (g YamlConfig) Parse() (*Config, error) {
6463
sort.Slice(sections, func(i, j int) bool {
6564
sectionI, sectionJ := sections[i].Type(), sections[j].Type()
6665

67-
if g.Cfg.NoLexOrder || strings.Compare(sectionI, sectionJ) != 0 {
66+
if g.Cfg.NoLexOrder || sectionI != sectionJ {
6867
return defaultOrder[sectionI] < defaultOrder[sectionJ]
6968
}
7069

71-
return strings.Compare(sections[i].String(), sections[j].String()) < 0
70+
return sections[i].String() < sections[j].String()
7271
})
7372
}
7473

pkg/section/standard_list.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/section/standard_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ func TestStandardPackageSpecificity(t *testing.T) {
1515
{"crypto/ae", Standard{}, specificity.MisMatch{}},
1616
{"crypto/aes", Standard{}, specificity.StandardMatch{}},
1717
{"crypto/aes2", Standard{}, specificity.MisMatch{}},
18+
{"syscall/js", Standard{}, specificity.StandardMatch{}},
1819
}
1920
testSpecificity(t, testCases)
2021
}

0 commit comments

Comments
 (0)