Windows配置Delve的测试环境
引言
自己最近在玩Go,在开发一些项目的时候需要调试,由于之前都是在GoLand上写的,但是这个IDE启动太慢并且不轻便。并且自己之前很多项目都是在Vscode中编写的,所以特意想在Vscode中配置Go的开发环境和调试环境,由于在安装的过程中遇到了不少的问题,希望在此给自己留一个笔记,以便未来不再犯类似的错误
dlv的安装
dlv相关网址
在这里给出dlv的下载地址dlv github Link, 在这个网站上有对这个工具的详细介绍,并且有着对应的文档可以参考。
其中dlv的安装可以分成Linux、MacOS、Windows三个方向,自己用的是Windows,所以在这给出Windows下安装的方法,这里是Windows安装的方法Windows 安装dlv方法
dlv的安装步骤
安装dlv之前确认自己已经安装好了
GoLang
并且配置好了GOROOT
和GOPATH
两个环境变量
打开cmd窗口输入命令
go get github.com/derekparker/delve/cmd/dlv
,等待几分钟,当下载完成之后可以切换到目录里GOPATH
查看;在cmd窗口种输入命令
cd %GOPATH%
,进入对应的目录文件夹里面在src目录里找到dlv所在路径并且切换过去,最终进入
_scripts
这个目录里面,开始编译安装按顺序分别执行以下命令:
go run make.go check-cert
go run make.go build
go run make.go install
执行完成之后,在cmd窗口中输入dlv后你会得到以下信息,说明dlv安装成功
Delve is a source level debugger for Go programs.
Delve enables you to interact with your program by controlling the execution of the process,
evaluating variables, and providing information of thread / goroutine state, CPU register state and more.
The goal of this tool is to provide a simple yet powerful interface for debugging Go programs.
Pass flags to the program you are debugging using `--`, for example:
`dlv exec ./hello -- server --config conf/config.toml`
Usage:
dlv [command]
Available Commands:
attach Attach to running process and begin debugging.
connect Connect to a headless debug server.
core Examine a core dump.
dap [EXPERIMENTAL] Starts a TCP server communicating via Debug Adaptor Protocol (DAP).
debug Compile and begin debugging main package in current directory, or the package specified.
exec Execute a precompiled binary, and begin a debug session.
help Help about any command
run Deprecated command. Use 'debug' instead.
test Compile test binary and begin debugging program.
trace Compile and begin tracing program.
version Prints version.
Flags:
--accept-multiclient Allows a headless server to accept multiple client connections.
--api-version int Selects API version when headless. New clients should use v2. Can be reset via RPCServer.SetApiVersion. See Documentation/api/json-rpc/README.md. (default 1)
--backend string Backend selection (see 'dlv help backend'). (default "default")
--build-flags string Build flags, to be passed to the compiler.
--check-go-version Checks that the version of Go in use is compatible with Delve. (default true)
--headless Run debug server only, in headless mode.
--init string Init file, executed by the terminal client.
-l, --listen string Debugging server listen address. (default "127.0.0.1:0")
--log Enable debugging server logging.
--log-dest string Writes logs to the specified file or file descriptor (see 'dlv help log').
--log-output string Comma separated list of components that should produce debug output (see 'dlv help log')
--only-same-user Only connections from the same user that started this instance of Delve are allowed to connect. (default true)
--wd string Working directory for running the program. (default ".")
Additional help topics:
dlv backend Help about the --backend flag.
dlv log Help about logging flags.
Use "dlv [command] --help" for more information about a command.
参考文档
- https://stackoverflow.com/questions/39058823/how-to-use-delve-debugger-in-visual-studio-code
- https://github.com/derekparker/delve/
- https://github.com/golang/vscode-go
- https://juejin.im/entry/5e69a2276fb9a07cd11db163
Windows配置Delve的测试环境的更多相关文章
- openstack私有云布署实践【4.2 上层代理haproxy+nginx配置 (办公网测试环境)】
续上一节说明 一开始我也是使用haproxy来做的,但后来方式改了,是因为物理机controller的高配置有些浪费,我需要1组高可用的上层nginx代理服务器来实现其它域名80代理访问,很多办公网测 ...
- (B)springboot配置开发和测试环境并添加启动路径
嗯,开发和测试环境要分离,这是一般共识(虽然我工作过的公司都没有这种分离),spring boot也可以按照配置文件的读取来做到这一点. 上图有三个application开头的配置文件,要达到能够读取 ...
- 微服务-springboot多环境配置(开发生产测试环境切换)
springboot根据spring.profiles.active会去寻找应该加载开发环境配置还是生产环境配置 application.properties #生产环境,开发环境,测试环境切换 pr ...
- Windows配置本地Hadoop运行环境
很多人喜欢用Windows本地开发Hadoop程序,这里是一个在Windows下配置Hadoop的教程. 首先去官网下载hadoop,这里需要下载一个工具winutils,这个工具是编译hadoop用 ...
- windows 配置 Scheme + Emacs 编程环境
软件下载列表: Emacs Racket (这里使用 Racket ,更加方便,便于后面配置 Emacs) 配置 安装好 Emacs 后,在 C:\Users\用户名\AppData\Roaming\ ...
- windows下web端测试环境搭建(tomcat+oracle)
一.安装oracle数据库 1.关闭防火墙.360安全卫士,运行安装程序:Setup.exe,然后下一步...... 2.安装完成后,检查服务是否已启动 3.cmd输入验证登录成功:sqlplus s ...
- vue项目打包配置多个测试环境与生产环境,用npm命令打出不同的资源包。
1.找到package.json文件,找到script节点.再新增一个新的脚本命令 test 2.修改prod.env.js配置文件,npm_lifecycle_event代表返回当前执行的脚本名称, ...
- VMWARE + CENTOS在windows下配置cocos2d-x android开发环境
VMWARE + CENTOS在windows配置cocos2d-x android开发环境 之前使用cygwin在windows开发android,后来使用了c++11特性,在cygwin中更新工具 ...
- Windows配置java运行环境的步骤
jdk不同版本下载地址:http://www.oracle.com/technetwork/java/javase/archive-139210.html 1.下载你适合你电脑的jdk版本,链接如上, ...
随机推荐
- Linux dd工具磁盘读写测试分析
话说,Linux 自带的dd工具测试硬盘读写速度只能提供一个大概的测试结果,而且是连续IO 而不是随机IO ,理论上文件规模越大,测试结果越准确.理论上bs越大,所测得性能越高. 上句来自网上,是不是 ...
- 【福利】FL Studio 20 汉化补丁包 _FL Studio 20 汉化包下载
我这两天在网上搜索FL Studio 20汉化包,找了半天也没有找到真正的汉化包,不过好在功夫不负有心人,让我找到了一个不错的FL Studio 20汉化网站,里面提供了FL Studio 20汉化包 ...
- HTML的简介和历史发展过程
HTML的简介和历史发展过程 前言 这次写一篇对于HTML以及CSS的简介,平常我们大家都知道的编程语言有很多种,比如Java.C++.Python等等,每种编程语言都有其独具的特色,不论是语法格式还 ...
- 用turtle画蛇
import turtle def drawSnake(rad,angle,len,nackrad): for i in range(len): turtle.circle(rad,angle) #画 ...
- fiddler修改请求参数
1.打开fiddler ,点击界面左侧左侧底部 2.此图标为before request请求(修改请求参数时,设置这个,可以修改请求参数) 3..再次点击该按钮,将图标切换到下图after respo ...
- rust 学习之旅二,关键字和保留字
当前,以下关键字具有所描述的功能. as-执行原始类型转换,消除包含项目的特定特征的歧义,或在useand extern crate语句中重命名项目async-返回a Future而不是阻塞当前线程a ...
- WeChair项目Alpha冲刺(2/10)
团队项目进行情况 1.昨日进展 Alpha冲刺第二天 昨日进展: 前端完成小程序首页的html+css设计 后端springboot项目搭建完成 详情参见github 数据库也初步建成一些表格, ...
- JAVA 经典算法 40 例
[程序 1] 题目:古典问题:有一对兔子,从出生后第 3 个月起每个月都生一对兔子,小兔子长到第四个月后每个月又生一对兔子,假如兔子都不死,问每个月的兔子总数为多少? 1.程序分析: 兔子的规律为数列 ...
- 我是如何从零学习开发一款跨平台桌面软件的(Markdown编辑器)
[本文版权归微信公众号"代码艺术"(ID:onblog)所有,若是转载请务必保留本段原创声明,违者必究.若是文章有不足之处,欢迎关注微信公众号私信与我进行交流!] 原始冲动 最近一 ...
- 「从零单排canal 03」 canal源码分析大纲
在前面两篇中,我们从基本概念理解了canal是一个什么项目,能应用于什么场景,然后通过一个demo体验,有了基本的体感和认识. 从这一篇开始,我们将从源码入手,深入学习canal的实现方式.了解can ...