push all exercices
This commit is contained in:
29
ch3/3/ch3_3.go
Normal file
29
ch3/3/ch3_3.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
type Employee struct {
|
||||
firstName string
|
||||
lastName string
|
||||
id int
|
||||
}
|
||||
|
||||
firstVal := Employee{
|
||||
"Ivan",
|
||||
"Ivanov",
|
||||
1,
|
||||
}
|
||||
secondVal := Employee{
|
||||
firstName: "Peter",
|
||||
lastName: "Petrov",
|
||||
id: 2,
|
||||
}
|
||||
var thirdVal Employee
|
||||
thirdVal.firstName = "Sergei"
|
||||
thirdVal.lastName = "Sidorov"
|
||||
thirdVal.id = 3
|
||||
fmt.Println(firstVal)
|
||||
fmt.Println(secondVal)
|
||||
fmt.Println(thirdVal)
|
||||
}
|
||||
Reference in New Issue
Block a user