You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: util/map.go
+75-10Lines changed: 75 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -3,27 +3,32 @@ package util
3
3
import (
4
4
"fmt"
5
5
"reflect"
6
+
"sort"
6
7
)
7
8
9
+
// toString wraps fmt.Sprint except that it converts nil to "null"
10
+
functoString(ininterface{}) string {
11
+
ifin==nil {
12
+
return"null"
13
+
}
14
+
15
+
returnfmt.Sprint(in)
16
+
}
17
+
8
18
// ForceStringKeys creates a copy of the provided interface{}, with all maps changed to have string keys for use by serialisers that expect string keys
9
-
// This is particularly useful for formatters where the target serialisation format only allows string keys
19
+
// This is useful for formatters where the target serialisation format only allows string keys
0 commit comments