samedi 21 novembre 2015

Set an interface to nil in Golang

I'm trying to set an internal value of an interface to nil something like the following :

typ := &TYP{InternalState: "filled"}
setNil(typ)

fmt.Printf("Expecting that %v to be nil", typ)

And I need to know how to implement the setNil(typ interface{}) method.

More details? see this code in play.golang.org





Aucun commentaire:

Enregistrer un commentaire