--- title: "GoTest" date: 2021-05-09T15:32:48+08:00 draft: false --- 2. irrelevant content 3. Exmaple ```go package random import ( "math/rand" "testing" "time" ) func TestPick(t *testing.T) { seed := time.Now().UnixNano() r := rand.New(rand.NewSource(seed)) arg := make([]int, 25) for i := 0; i < 25; i++ { arg[i] = r.Int() } got := Pick(arg) for _, v := range arg { if got == v { return } } t.Errorf("Pick(seed=%d) = %d; not in slice", seed, got) } ```