About func and goroutine

func is a pointer?!

package main

import (
	"fmt"
	"time"
)

func testStatic(i int) {
	fmt.Println("(testStatic)",i)
}

type testSingleton struct{}

func (t *testSingleton) Print(i int) {
	fmt.Println("testSingle",i)
}

func main() {
	test := testSingleton{}
	times := 20
	for i := 0; i < times; i++ {
		go func(i int) {
			testStatic(i)
			test.Print(i)
		}(i)
	}
	time.Sleep(10)
}

Output

(testStatic) 1
(testStatic) 8
testSingle 8
(testStatic) 3
testSingle 3
(testStatic) 11
testSingle 11
(testStatic) 6
testSingle 6
testSingle 1
(testStatic) 4
testSingle 4
(testStatic) 12
testSingle 12
(testStatic) 14
testSingle 14
(testStatic) 19
testSingle 19
(testStatic) 18
testSingle 18
(testStatic) 17
testSingle 17
(testStatic) 0
testSingle 0
(testStatic) 7
testSingle 7
(testStatic) 13
testSingle 13
(testStatic) 10
testSingle 10
(testStatic) 2
testSingle 2
(testStatic) 15
testSingle 15
(testStatic) 16
testSingle 16
(testStatic) 9
testSingle 9
(testStatic) 5
testSingle 5

Go Playground