Skip to content

Commit 0a6b89a

Browse files
authored
Update slices (#897)
1 parent b7de07a commit 0a6b89a

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ require (
1515
github.com/pmezard/go-difflib v1.0.0
1616
github.com/spf13/cobra v1.7.0
1717
github.com/spf13/viper v1.15.0
18+
golang.org/x/exp v0.0.0-20230725093048-515e97ebf090
1819
google.golang.org/grpc v1.58.0-dev
1920
google.golang.org/protobuf v1.31.0
2021
)

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0
237237
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
238238
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
239239
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
240+
golang.org/x/exp v0.0.0-20230725093048-515e97ebf090 h1:Di6/M8l0O2lCLc6VVRWhgCiApHV8MnQurBnFSHsQtNY=
241+
golang.org/x/exp v0.0.0-20230725093048-515e97ebf090/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
240242
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
241243
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
242244
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=

ygot/render.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1565,7 +1565,7 @@ func mapJSON(field reflect.Value, parentMod string, args jsonOutputConfig) (any,
15651565
}
15661566
pairs = append(pairs, mapValuePair{k: kn, v: iter.Value()})
15671567
}
1568-
slices.SortFunc(pairs, func(a, b mapValuePair) bool { return a.k < b.k })
1568+
slices.SortFunc(pairs, func(a, b mapValuePair) int { return strings.Compare(a.k, b.k) })
15691569

15701570
js, err := mapValuePairsToJSON(pairs, parentMod, args)
15711571
errs.Add(err)

0 commit comments

Comments
 (0)