File: issue3548.go

package info (click to toggle)
delve 1.26.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,136 kB
  • sloc: ansic: 111,947; sh: 194; asm: 147; makefile: 43; python: 23
file content (35 lines) | stat: -rw-r--r-- 378 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package main

import (
	"fmt"
)

type Thing struct {
	str string
}

func (d *Thing) Test() bool {
	return d != nil
}

func callit(f func()) {
	f()
}

func main() {
	cases := []struct {
		name  string
		thing Thing
	}{
		{
			name:  "Success",
			thing: Thing{str: "hello"},
		},
	}

	for _, c := range cases {
		callit(func() {
			fmt.Println("hello", c.thing.Test())
		})
	}
}