Last active
May 24, 2016 15:24
-
-
Save gnufied/0c8056d8be362fd26a085c740a8b5634 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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