Skip to content

Instantly share code, notes, and snippets.

@lizthegrey
Created September 8, 2016 00:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lizthegrey/d0362b396418ac2019b29648c233b9ec to your computer and use it in GitHub Desktop.
Save lizthegrey/d0362b396418ac2019b29648c233b9ec to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"reflect"
)
func main() {
var empty []string
empty2 := []string{}
empty3 := make([]string, 0)
if reflect.DeepEqual([]string{}, empty) {
fmt.Println("equal 1")
}
if reflect.DeepEqual([]string{}, empty2) {
fmt.Println("equal 2")
}
if reflect.DeepEqual([]string{}, empty3) {
fmt.Println("equal 3")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment