Skip to content

Instantly share code, notes, and snippets.

@gnufied
Last active May 24, 2016 15:24
Show Gist options
  • Save gnufied/0c8056d8be362fd26a085c740a8b5634 to your computer and use it in GitHub Desktop.
Save gnufied/0c8056d8be362fd26a085c740a8b5634 to your computer and use it in GitHub Desktop.
package main
import "fmt"
type Foo struct {
whitelist []string
}
func main() {
foo := new(Foo)
foo.whitelist = []string{}
if foo.whitelist == nil {
// these lines won't be printed
fmt.Println("Whitelist is nil")
fmt.Println(foo.whitelist)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment