Go 调试测试以及调试工具 dlv 学习
调试Go工程 ::: tip prepare: vscode golang 1.92 ::: demo go mod init test In main.go file package main import ( "fmt" ) // Swap functions func swap(x, y *string) (string, string) { //XOR exchange *x, *y = *y, *x } func main() { fmt.Println("Hello, world!") //Swap functions for i := 0; i < 10; i++ { a := "a" b := "b" swap(&a, &b) fmt.Println(a, b) } } vscode一键生成测试 >gotest for package/function ::: tip 分别是为包生成测试单元,为函数生成测试单元。 :::...