Last active
June 15, 2016 15:15
-
-
Save dr2chase/acdd448e4fd19fdca6ab8551e55772a9 to your computer and use it in GitHub Desktop.
Test file for delve stepping
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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