github.com/searKing/golang/go@v1.2.117/encoding/prettyjson/encopts.options.go (about) 1 // Copyright 2023 The searKing Author. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package prettyjson 6 7 // WithEncOptsTruncate sets truncate in encOpts. 8 func WithEncOptsTruncate(v int) EncOptsOption { 9 return EncOptsOptionFunc(func(o *encOpts) { 10 o.truncateBytes = v 11 o.truncateString = v 12 o.truncateMap = v 13 o.truncateSliceOrArray = v 14 }) 15 }