MCPcopy Create free account
hub / github.com/Go-Learning-Land/Go-Learning-Archive / main

Function main

GolangBasics/GoByExample/018Struct.go:18–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16}
17
18func main() {
19
20 fmt.Println(person{"Bob", 20})
21
22 fmt.Println(person{name: "Alice", age: 30})
23
24 fmt.Println(person{name: "Fred"})
25
26 fmt.Println(&person{name: "Ann", age: 40})
27
28 fmt.Println(newPerson("Jon"))
29
30 s := person{name: "Sean", age: 50}
31 fmt.Println(s.name)
32
33 sp := &s
34 fmt.Println(sp.age)
35
36 sp.age = 51
37 fmt.Println(sp.age)
38}

Callers

nothing calls this directly

Calls 2

newPersonFunction · 0.85
PrintlnMethod · 0.80

Tested by

no test coverage detected