Skip to content
This repository has been archived by the owner on Oct 11, 2018. It is now read-only.

Latest version panics on interface{} #61

Closed
davrux opened this issue Jun 15, 2016 · 1 comment
Closed

Latest version panics on interface{} #61

davrux opened this issue Jun 15, 2016 · 1 comment

Comments

@davrux
Copy link
Contributor

davrux commented Jun 15, 2016

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.

@fatih
Copy link
Owner

fatih commented Jun 16, 2016

Was fixed with #62

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants