Last active
December 31, 2018 14:05
-
-
Save shumon84/889276f3abea009499beedac8f64f2e1 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 { | |
A int | |
B struct { | |
X int | |
Y struct{ | |
N int | |
} | |
} | |
} | |
func main() { | |
hoges := []Hoge{ | |
Hoge{ | |
A: 1, | |
B: struct { | |
X int | |
Y struct { | |
N int | |
} | |
}{ | |
X: 2, | |
Y: struct { | |
N int | |
}{ | |
N: 3, | |
}, | |
}, | |
}, | |
Hoge{ | |
A: 10, | |
B: struct { | |
X int | |
Y struct { | |
N int | |
} | |
}{ | |
X: 20, | |
Y: struct { | |
N int | |
}{ | |
N: 30, | |
}, | |
}, | |
}, | |
} | |
fmt.Println(hoges[0]) | |
fmt.Println(hoges[1]) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment