mirror of
https://github.com/json-iterator/go.git
synced 2025-01-23 18:54:21 +02:00
fix golint: document exported symbols
This commit is contained in:
parent
3b6853d209
commit
8fbed91768
@ -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 {
|
||||
|
@ -5,6 +5,7 @@ import (
|
||||
"unicode"
|
||||
)
|
||||
|
||||
// SupportPrivateFields include private fields when encoding/decoding
|
||||
func SupportPrivateFields() {
|
||||
jsoniter.RegisterExtension(&privateFieldsExtension{})
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
// keep epoch milliseconds
|
||||
// RegisterTimeAsInt64Codec encode/decode time since number of unit since epoch. the precision is the unit.
|
||||
func RegisterTimeAsInt64Codec(precision time.Duration) {
|
||||
jsoniter.RegisterTypeEncoder("time.Time", &timeAsInt64Codec{precision})
|
||||
jsoniter.RegisterTypeDecoder("time.Time", &timeAsInt64Codec{precision})
|
||||
|
Loading…
x
Reference in New Issue
Block a user