File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 4
4
"fmt"
5
5
"math"
6
6
"net"
7
+ "reflect"
7
8
)
8
9
9
10
// AppendNil inserts a 'Nil' object into the dst byte array.
@@ -438,6 +439,14 @@ func (e Encoder) AppendInterface(dst []byte, i interface{}) []byte {
438
439
return AppendEmbeddedJSON (dst , marshaled )
439
440
}
440
441
442
+ // AppendType appends the parameter type (as a string) to the input byte slice.
443
+ func (e Encoder ) AppendType (dst []byte , i interface {}) []byte {
444
+ if i == nil {
445
+ return e .AppendString (dst , "<nil>" )
446
+ }
447
+ return e .AppendString (dst , reflect .TypeOf (i ).String ())
448
+ }
449
+
441
450
// AppendIPAddr encodes and inserts an IP Address (IPv4 or IPv6).
442
451
func (e Encoder ) AppendIPAddr (dst []byte , ip net.IP ) []byte {
443
452
dst = append (dst , majorTypeTags | additionalTypeIntUint16 )
You can’t perform that action at this time.
0 commit comments