
go
go 语言
墨一鉴
软件攻城狮
展开
-
vscode 调试 go 程序
DebuggingThe Go extension allows you to launch or attach to Go programs for debugging. You can inspect variables and stacks, setting breakpoints, and do other debugging activities using VS Code’s Debugging UI.These debugging features are possible by usin转载 2021-12-01 08:00:00 · 4188 阅读 · 0 评论 -
go 程序的调试
go 编译的程序默认包含调试信息,通过 -ldflags "-w -s" 可去除调试信息。其中-w 去掉DWARF调试信息,-s为去掉符号表。go 语言有多种调试方式,可通过 ide,gdb 等方式调试。ide 比 gdb 要方便不少。当没有 ide 时,使用 gdb 也不错。下面分享两个 gdb 使用技巧:# 有时 打断点不知道文件或函数路径可用下面的方法查找info sources # 列出所有源文件info functions # 列出所有函数## 搜索info sources xxxf原创 2021-11-13 16:00:00 · 1532 阅读 · 0 评论 -
golang 的 goproxy 配置
首先开启go modulego env -w GO111MODULE=on // Windows export GO111MODULE=on // macOS 或 Linux配置goproxy:阿里配置:go env -w GOPROXY=https://mirrors.aliyun.com/goproxy/ // Windows export GOPROXY=https://mirrors.aliyun.com/goproxy/ // macOS 或 Linux转载 2021-10-29 18:48:40 · 5118 阅读 · 1 评论 -
go 之 GOPATH
go 在安装之后会设置一个环境变量 GOPATH通过 go env 命令可以查看,默认是 ~/gogo build,go install,go get 等命令执行时会从 GOPATH 目录下的 src 去查找源码https://www.cnblogs.com/hongdada/p/10338015.html原创 2021-10-29 17:23:09 · 6305 阅读 · 1 评论