update field (#8)
Reviewed-on: #8 Co-authored-by: andrey <andrey@4devs.io> Co-committed-by: andrey <andrey@4devs.io>
This commit was merged in pull request #8.
This commit is contained in:
17
field/encoder_text.go
Normal file
17
field/encoder_text.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package field
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func NewEncoderText(opts ...func(*BaseEncoder)) BaseEncoder {
|
||||
opts = append([]func(*BaseEncoder){
|
||||
WithGropuConfig(0, 0, ' '),
|
||||
WithNullValue("<nil>"),
|
||||
WithDefaultValue(func(dst []byte, _ Encoder, val Value) []byte {
|
||||
return fmt.Appendf(dst, "%+v", val.Any())
|
||||
}),
|
||||
}, opts...)
|
||||
|
||||
return NewEncoder(opts...)
|
||||
}
|
||||
Reference in New Issue
Block a user