go语言-在mac下brew升级golang
来源:脚本之家
2023-01-07 15:56:21
0浏览
收藏
知识点掌握了,还需要不断练习才能熟练运用。下面golang学习网给大家带来一个Golang开发实战,手把手教大家学习《go语言-在mac下brew升级golang》,在实现功能的过程中也带大家重新温习相关知识点,温故而知新,回头看看说不定又有不一样的感悟!
在命令行下直接运行:
brew upgrade go
补充:mac下更新delve调试go语言
概述
delve 是golang调试程序。但如果版本不配套, mac下goland 调试,step over会不起作用,直接变成执行完毕或者到下一个断点。 需要更新调试器delve解决。
go get安装
mac下安装delve,官方教程是两步。
$ xcode-select --install xcode-select: error: command line tools are already installed, use "Software Update" to install updates $ go get -u github.com/derekparker/delve/cmd/dlv
但go get 一直不返回。
homebrew 安装
zhouhh@/Users/zhouhh $ brew install go-delve/delve/delve Updating Homebrew... ==> Installing delve from go-delve/delve ==> Downloading https://github.com/derekparker/delve/archive/v1.0.0.tar.gz Already downloaded: /Users/zhouhh/Library/Caches/Homebrew/delve-1.0.0.tar.gz security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain. ==> Generating dlv-cert ==> openssl req -new -newkey rsa:2048 -x509 -days 3650 -nodes -config dlv-cert.cfg -extensions codesign_reqext -batch -out dlv-cert.cer -keyout dlv-cert.key ==> [SUDO] Installing dlv-cert as root ==> sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain dlv-cert.cer Last 15 lines from /Users/zhouhh/Library/Logs/Homebrew/delve/02.sudo: 2018-08-09 17:07:38 +0800 sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain dlv-cert.cer If reporting this issue please do so at (not Homebrew/brew or Homebrew/core): https://github.com/go-delve/homebrew-delve/issues These open issues may also help: Upgrade to delve fails https://github.com/go-delve/homebrew-delve/issues/20 /usr/local/Homebrew/Library/Homebrew/exceptions.rb:426:in `block in dump': undefined method `check_for_bad_install_name_tool' for #<:diagnostic::checks:0x007fc5df858bd8> (NoMethodError) Did you mean? check_for_tap_ruby_files_locations from /usr/local/Homebrew/Library/Homebrew/exceptions.rb:425:in `each' from /usr/local/Homebrew/Library/Homebrew/exceptions.rb:425:in `dump' from /usr/local/Homebrew/Library/Homebrew/brew.rb:138:in `rescue in' from /usr/local/Homebrew/Library/Homebrew/brew.rb:30:in ` '
这是因为证书有问题。 可以到homebrew缓存下载的delve里处理一下。
zhouhh@/Users/zhouhh $ cd $HOME/Library/Caches/Homebrew zhouhh@/Users/zhouhh/Library/Caches/Homebrew $ ls del* delve-1.0.0.tar.gz zhouhh@/Users/zhouhh/Library/Caches/Homebrew $ tar zxvf delve-1.0.0.tar.gz zhouhh@/Users/zhouhh/Library/Caches/Homebrew $ sh delve-1.0.0/scripts/gencert.sh Password:
再安装成功
zhouhh@/Users/zhouhh/Library/Caches/Homebrew $ CGO_ENABLED=1 brew install go-delve/delve/delve
==> Installing delve from go-delve/delve
==> Downloading https://github.com/derekparker/delve/archive/v1.0.0.tar.gz
Already downloaded: /Users/zhouhh/Library/Caches/Homebrew/delve-1.0.0.tar.gz
==> dlv-cert is already installed, no need to create it
==> make build BUILD_SHA=v1.0.0
==> Caveats
If you get "could not launch process: could not fork/exec", you need to try
in a new terminal.
When uninstalling, to remove the dlv-cert certificate, run this command:
$ sudo security delete-certificate -t -c dlv-cert /Library/Keychains/System.keychain
Alternatively, you may want to delete from the Keychain (with the Imported private key).
==> Summary
🍺 /usr/local/Cellar/delve/1.0.0: 6 files, 10.6MB, built in 13 seconds
安装成功
修改ide环境
安装完最新的 delve 后,如 brew install delve, 然后在IntelliJ或goland中点击
Help → Edit Custom Properties...
添加新行
dlv.path=/usr/local/bin/dlv
保存重启,解决step over(F8) 直接运行完毕的bug。
以上为个人经验,希望能给大家一个参考,也希望大家多多支持golang学习网。如有错误或未考虑完全的地方,望不吝赐教。
今天关于《go语言-在mac下brew升级golang》的内容就介绍到这里了,是不是学起来一目了然!想要了解更多关于golang的内容请关注golang学习网公众号!
版本声明
本文转载于:脚本之家 如有侵犯,请联系study_golang@163.com删除
Golang 正则匹配效率详解
- 上一篇
- Golang 正则匹配效率详解
- 下一篇
- go原生库的中bytes.Buffer用法
查看更多
最新文章
-
- Golang · Go教程 | 34分钟前 | 反射 · Go教程 · 结构体标签 · 字段元数据 · Go reflect.StructTag StructTag.Lookup StructTag.Get
- Go reflect.StructTag 怎么读取自定义字段标签
- 291浏览 收藏
-
- Golang · Go教程 | 58分钟前 |
- Go iter.Seq2 返回键值时怎么避免复制大对象
- 441浏览 收藏
-
- Golang · Go教程 | 1小时前 |
- Go iter.Seq 怎么把分页查询包装成惰性遍历
- 203浏览 收藏
-
- Golang · Go教程 | 1小时前 | 排序 · go · Slices · Maps · Go maps.Keys slices.Sorted slices.Sort
- Go maps.Keys 收集键后怎么得到稳定排序结果
- 158浏览 收藏
-
- Golang · Go教程 | 1小时前 |
- Go maps.Copy 合并配置时怎么明确覆盖方向
- 391浏览 收藏
-
- Golang · Go教程 | 1小时前 |
- Go maps.Clone 复制嵌套 map 时哪些数据仍然共享
- 501浏览 收藏
-
- Golang · Go教程 | 2小时前 |
- Go slices.Insert 批量插入时怎么判断容量是否复用
- 109浏览 收藏
-
- Golang · Go教程 | 2小时前 | go · Slices · 内存管理 · Go 切片 slices.Delete 内存引用
- Go slices.Delete 删除元素后怎么避免旧数组残留引用
- 200浏览 收藏
-
- Golang · Go教程 | 2小时前 | 定时任务 · Context · 并发编程 · Go教程 · 资源清理 · select time.Ticker context取消 goroutine退出 Go ticker
- Go ticker 阻塞读取时怎么配合 context 取消
- 490浏览 收藏
-
- Golang · Go教程 | 2小时前 | go · 并发控制 · time.Ticker · Go reset time.Ticker 配置刷新
- Go 定时刷新配置时怎么避免重复创建 Ticker
- 161浏览 收藏
查看更多
课程推荐
-
- 前端进阶之JavaScript设计模式
- 设计模式是开发人员在软件开发过程中面临一般问题时的解决方案,代表了最佳的实践。本课程的主打内容包括JS常见设计模式以及具体应用场景,打造一站式知识长龙服务,适合有JS基础的同学学习。
- 543次学习
-
- GO语言核心编程课程
- 本课程采用真实案例,全面具体可落地,从理论到实践,一步一步将GO核心编程技术、编程思想、底层实现融会贯通,使学习者贴近时代脉搏,做IT互联网时代的弄潮儿。
- 516次学习
-
- 简单聊聊mysql8与网络通信
- 如有问题加微信:Le-studyg;在课程中,我们将首先介绍MySQL8的新特性,包括性能优化、安全增强、新数据类型等,帮助学生快速熟悉MySQL8的最新功能。接着,我们将深入解析MySQL的网络通信机制,包括协议、连接管理、数据传输等,让
- 500次学习
-
- JavaScript正则表达式基础与实战
- 在任何一门编程语言中,正则表达式,都是一项重要的知识,它提供了高效的字符串匹配与捕获机制,可以极大的简化程序设计。
- 487次学习
-
- 从零制作响应式网站—Grid布局
- 本系列教程将展示从零制作一个假想的网络科技公司官网,分为导航,轮播,关于我们,成功案例,服务流程,团队介绍,数据部分,公司动态,底部信息等内容区块。网站整体采用CSSGrid布局,支持响应式,有流畅过渡和展现动画。
- 485次学习
查看更多
AI推荐
-
- H2O EvalGPT
- H2O EvalGPT是H2O.ai推出的开源LLM评估平台,提供详细的大模型性能排行榜、行业特定基准测试及A/B测试功能,助您快速选择最适合项目的高性能大语言模型。
- 19次使用
-
- SuperCLUE
- SuperCLUE是权威的中文大语言模型综合评测基准,涵盖语言理解、知识应用、AI Agent智能体及安全性等12项核心能力。通过多轮对话与客观测试,定期发布榜单与技术报告,为模型研发、优化及行业选型提供科学依据。
- 174次使用
-
- C-Eval
- 深入了解C-Eval中文评估套件,涵盖52个学科与4级难度。本文详解其功能特点、Zero-shot/Few-shot使用方法及代码示例,助您全面评测LLM中文理解与泛化能力。
- 110次使用
-
- AI Prompt Library
- 探索AI Prompt Library免费资源库,涵盖营销、写作及多场景AI提示词。兼容ChatGPT、Claude等工具,一键复制优化输出,提升工作效率。
- 37次使用
-
- Generrated
- Generrated汇集9300+张DALL·E生成图像及对应提示词,支持查看完整图集、对比DALL·E 2与3版本差异,是AI绘图新手学习Prompt设计与获取创作灵感的实用工具。
- 17次使用
查看更多
相关文章
-
- Java 性能优化上线清单:从定位、改造到灰度发布
- 2026-06-11 860浏览
-
- Spring Boot 压测验证:Gatling、JMeter 与性能回归门禁
- 2026-06-11 843浏览
-
- Java NMT 非堆内存排查:Direct Buffer、线程栈与 Metaspace 分析
- 2026-06-11 826浏览
-
- Spring Boot 容器内存优化:JVM 堆、非堆与 MaxRAMPercentage
- 2026-06-11 809浏览
-
- Tomcat 连接与线程参数调优:maxThreads、acceptCount 与 KeepAlive
- 2026-06-11 792浏览
