-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(swissmap): add
WithSortMapKeys
option
Signed-off-by: Dwi Siswanto <[email protected]>
- Loading branch information
1 parent
8b86421
commit 72ef9f3
Showing
4 changed files
with
94 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package swissmap | ||
|
||
import "github.com/bytedance/sonic" | ||
|
||
// getDefaultSonicConfig provides the default configuration for the Sonic | ||
// library. | ||
// | ||
// This function returns a [sonic.Config] instance with standard `encoding/json` | ||
// settings but with unsorted map keys. You may want to use the [WithSortMapKeys] | ||
// option to enable sorting of map keys. | ||
func getDefaultSonicConfig() sonic.Config { | ||
return sonic.Config{ | ||
EscapeHTML: true, | ||
CompactMarshaler: true, | ||
CopyString: true, | ||
ValidateString: true, | ||
} | ||
} |