1
0
mirror of https://github.com/json-iterator/go.git synced 2025-11-29 22:47:28 +02:00

fix golint: document exported symbols

This commit is contained in:
Tao Wen
2017-07-09 14:17:40 +08:00
parent 3b6853d209
commit 8fbed91768
3 changed files with 4 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ import (
"unicode"
)
// SetNamingStrategy rename struct fields uniformly
func SetNamingStrategy(translate func(string) string) {
jsoniter.RegisterExtension(&namingStrategyExtension{jsoniter.DummyExtension{}, translate})
}
@@ -21,6 +22,7 @@ func (extension *namingStrategyExtension) UpdateStructDescriptor(structDescripto
}
}
// LowerCaseWithUnderscores one strategy to SetNamingStrategy for. It will change HelloWorld to hello_world.
func LowerCaseWithUnderscores(name string) string {
newName := []rune{}
for i, c := range name {