This commit is contained in:
2025-05-08 21:41:05 +03:00
parent e6b195fbb1
commit f07b30bf52
2 changed files with 5 additions and 0 deletions

4
ndb.go
View File

@@ -203,6 +203,10 @@ func (e *Encoder) Encode(v interface{}) error {
defer func() {
e.start = false
}()
return Switch(e, v)
}
func Switch(e *Encoder, v reflect.Value) error {
switch val.Kind() {
case reflect.Slice:
return e.encodeSlice(val)