Skip to content

Instantly share code, notes, and snippets.

@dr2chase
Last active June 15, 2016 15:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dr2chase/acdd448e4fd19fdca6ab8551e55772a9 to your computer and use it in GitHub Desktop.
Save dr2chase/acdd448e4fd19fdca6ab8551e55772a9 to your computer and use it in GitHub Desktop.
Test file for delve stepping
package main
// A delve stepping test.
// dlv debug
// b main.foo
// c
// s
// s
// Expect to be stopped in fmt.Printf or runtime.duffzero
import "fmt"
var v int = 99
func foo(x, y int) (z int) { // c goes here
fmt.Printf("x=%d, y=%d, z=%d\n", x, y, z) // s #1 goes here
z = x + y
return
}
func main() {
x := v
y := x * x
z := foo(x, y)
fmt.Printf("z=%d\n", z)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment