Created
September 15, 2017 05:08
-
-
Save ara-ta3/7acb72a2d61b7588939e5ad858849e57 to your computer and use it in GitHub Desktop.
This file contains 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 Hoge struct { | |
AAA string | |
} | |
type Fuga struct { | |
hs map[string]Hoge | |
} | |
func main() { | |
f1 := Fuga{ | |
hs: map[string]Hoge{ | |
"xxx": {AAA: "yyy"}, | |
}, | |
} | |
f2 := Fuga{ | |
hs: map[string]Hoge{ | |
"xxx": Hoge{AAA: "yyy"}, // Redundant type Declaration | |
}, | |
} | |
fmt.Printf("%+v\n", f1) | |
fmt.Printf("%+v\n", f2) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment