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
{{ message }}
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.
I want to decode the values from a struct to another struct, it works for all primitive datatypes but not for custom types like the Foobar example which uses the World struct as new custom type for Hello.
type World struct {
time.Time
}
type Foobar struct {
Hello World
}
type Dest struct {
CurrentTime World `mapstructure:"Hello"`
}
src := Foobar{
Hello: time.Now(),
}
var dest Dest
mapstructure.Decode(src, &dest)
I have the same problem with sql.NullString.
The problem is I have to decode the complete struct in the hook function and I hope I can do it easier.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello,
I want to decode the values from a struct to another struct, it works for all primitive datatypes but not for custom types like the Foobar example which uses the World struct as new custom type for Hello.
I have the same problem with sql.NullString.
The problem is I have to decode the complete struct in the hook function and I hope I can do it easier.
The text was updated successfully, but these errors were encountered: