Исходники и презентации
This commit is contained in:
16
lessons/structs/struct/main.go
Normal file
16
lessons/structs/struct/main.go
Normal file
@ -0,0 +1,16 @@
|
||||
package main
|
||||
|
||||
type Data struct {
|
||||
x int
|
||||
y int
|
||||
}
|
||||
|
||||
func main() {
|
||||
// 1 way
|
||||
data1 := Data{10, 20}
|
||||
_ = data1
|
||||
|
||||
// 2 way
|
||||
data2 := Data{x: 10, y: 20}
|
||||
_ = data2
|
||||
}
|
||||
Reference in New Issue
Block a user