Latest version panics on interface{}
davrux opened this issue · comments
The following program will panic, because interface type in struct.
Older Versions supported it.
package main
import (
"fmt"
"github.com/fatih/structs"
)
type MyStruct struct {
PublicKey interface{}
}
func main() {
mystruct := MyStruct{PublicKey: []byte("test")}
s := structs.Map(mystruct)
fmt.Printf("s %+v\n", s)
}
Tried to structs.Map an x509 certificate from crypto/x509 and it panics.
Older Version, commit e5ca5fe, does not have this problem.
Panic trace shows structs.go:119, where the last commit was around.
Was fixed with #62