You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
As described in decoder: Keys are "paths" in dotted notation to the struct fields and nested structs
However, encoder does not acted like this.
Versions
Go version: go1.16.2 darwin/amd64
package version: v1.2.0
Steps to Reproduce
package main
import (
"fmt""github.com/gorilla/schema"
)
typeconfigstruct {
Userstruct{
Usernamestring`schema:"username"`
} `schema:"user"`
}
funcmain() {
c:=config{}
c.User.Username="gorilla"m:=map[string][]string{}
enc:=schema.NewEncoder()
enc.Encode(&c, m)
fmt.Printf("config by gorilla: %+v", m)
}
Expected
config by gorilla: map[user.username:[gorilla]]
Actually got
config by gorilla: map[username:[gorilla]]
The text was updated successfully, but these errors were encountered:
Describe the bug
As described in decoder:
Keys are "paths" in dotted notation to the struct fields and nested structs
However, encoder does not acted like this.
Versions
go1.16.2 darwin/amd64
v1.2.0
Steps to Reproduce
config by gorilla: map[user.username:[gorilla]]
config by gorilla: map[username:[gorilla]]
The text was updated successfully, but these errors were encountered: