delve/_fixtures/testvariables.go
Derek Parker dcf9f04d45 Improve variable evaluation scope
Properly scope variable evaluation to the function the traced process is
currently stopped in.
2014-11-10 21:26:13 -06:00

36 lines
478 B
Go

package main
import "fmt"
type FooBar struct {
Baz int
Bur string
}
func barfoo() {
a1 := "bur"
fmt.Println(a1)
}
func foobar(baz string) {
var (
a1 = "foo"
a2 = 6
a3 = 7.23
a4 = [2]int{1, 2}
a5 = []int{1, 2, 3, 4, 5}
a6 = FooBar{Baz: 8, Bur: "word"}
a7 = &FooBar{Baz: 5, Bur: "strum"}
neg = -1
i8 = int8(1)
f32 = float32(1.2)
)
barfoo()
fmt.Println(a1, a2, a3, a4, a5, a6, a7, baz, neg, i8, f32)
}
func main() {
foobar("bazburzum")
}