This commit is contained in:
Alexander Pivkin 2025-09-02 17:37:51 +03:00
parent ce7565827e
commit f7fe833d3e
3 changed files with 33 additions and 0 deletions

3
headFirst/struct/go.mod Normal file
View File

@ -0,0 +1,3 @@
module main
go 1.24.6

View File

@ -0,0 +1,11 @@
package help
type Info struct {
Name string
Age int
Inner
}
type Inner struct {
Test string
}

19
headFirst/struct/main.go Normal file
View File

@ -0,0 +1,19 @@
package main
import (
"fmt"
"main/help"
)
func showStruct(p *help.Info) {
fmt.Println(p.Name)
fmt.Println(p.Age)
fmt.Println(p.Test)
}
func main() {
k := help.Info{Name:"kek",Age: 19}
k.Test = "lol"
showStruct(&k)
}