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 正则匹配效率详解

- 下一篇
- go原生库的中bytes.Buffer用法
查看更多
最新文章
-
- Golang · Go教程 | 3小时前 |
- Debian中处理Strings编码问题的技巧
- 381浏览 收藏
-
- Golang · Go教程 | 14小时前 |
- Debian备份与恢复操作攻略
- 486浏览 收藏
-
- Golang · Go教程 | 16小时前 |
- Tigervnc在Debian上是否与防火墙有冲突
- 276浏览 收藏
-
- Golang · Go教程 | 17小时前 |
- Debian上Kubernetes性能优化秘籍
- 419浏览 收藏
-
- Golang · Go教程 | 19小时前 |
- Golang在Debian上的安全配置攻略
- 201浏览 收藏
-
- Golang · Go教程 | 21小时前 |
- Go语言高并发优化攻略,突破性能瓶颈
- 208浏览 收藏
-
- Golang · Go教程 | 22小时前 |
- Go语言切片与数组易混淆问题深度解析
- 102浏览 收藏
-
- Golang · Go教程 | 1天前 | log ZAP 异步日志 lumberjack 日志轮转
- Go语言高效日志记录与管理秘籍
- 362浏览 收藏
-
- Golang · Go教程 | 1天前 |
- Filebeat在Debian上的安装配置攻略
- 271浏览 收藏
-
- Golang · Go教程 | 1天前 |
- Debian记事本插件扩展功能全面解析
- 184浏览 收藏
查看更多
课程推荐
-
- 前端进阶之JavaScript设计模式
- 设计模式是开发人员在软件开发过程中面临一般问题时的解决方案,代表了最佳的实践。本课程的主打内容包括JS常见设计模式以及具体应用场景,打造一站式知识长龙服务,适合有JS基础的同学学习。
- 542次学习
-
- GO语言核心编程课程
- 本课程采用真实案例,全面具体可落地,从理论到实践,一步一步将GO核心编程技术、编程思想、底层实现融会贯通,使学习者贴近时代脉搏,做IT互联网时代的弄潮儿。
- 508次学习
-
- 简单聊聊mysql8与网络通信
- 如有问题加微信:Le-studyg;在课程中,我们将首先介绍MySQL8的新特性,包括性能优化、安全增强、新数据类型等,帮助学生快速熟悉MySQL8的最新功能。接着,我们将深入解析MySQL的网络通信机制,包括协议、连接管理、数据传输等,让
- 497次学习
-
- JavaScript正则表达式基础与实战
- 在任何一门编程语言中,正则表达式,都是一项重要的知识,它提供了高效的字符串匹配与捕获机制,可以极大的简化程序设计。
- 487次学习
-
- 从零制作响应式网站—Grid布局
- 本系列教程将展示从零制作一个假想的网络科技公司官网,分为导航,轮播,关于我们,成功案例,服务流程,团队介绍,数据部分,公司动态,底部信息等内容区块。网站整体采用CSSGrid布局,支持响应式,有流畅过渡和展现动画。
- 484次学习
查看更多
AI推荐
-
- PPTFake答辩PPT生成器
- PPTFake答辩PPT生成器,专为答辩准备设计,极致高效生成PPT与自述稿。智能解析内容,提供多样模板,数据可视化,贴心配套服务,灵活自主编辑,降低制作门槛,适用于各类答辩场景。
- 6次使用
-
- Lovart
- SEO摘要探索Lovart AI,这款专注于设计领域的AI智能体,通过多模态模型集成和智能任务拆解,实现全链路设计自动化。无论是品牌全案设计、广告与视频制作,还是文创内容创作,Lovart AI都能满足您的需求,提升设计效率,降低成本。
- 6次使用
-
- 美图AI抠图
- 美图AI抠图,依托CVPR 2024竞赛亚军技术,提供顶尖的图像处理解决方案。适用于证件照、商品、毛发等多场景,支持批量处理,3秒出图,零PS基础也能轻松操作,满足个人与商业需求。
- 26次使用
-
- PetGPT
- SEO摘要PetGPT 是一款基于 Python 和 PyQt 开发的智能桌面宠物程序,集成了 OpenAI 的 GPT 模型,提供上下文感知对话和主动聊天功能。用户可高度自定义宠物的外观和行为,支持插件热更新和二次开发。适用于需要陪伴和效率辅助的办公族、学生及 AI 技术爱好者。
- 24次使用
-
- 可图AI图片生成
- 探索快手旗下可灵AI2.0发布的可图AI2.0图像生成大模型,体验从文本生成图像、图像编辑到风格转绘的全链路创作。了解其技术突破、功能创新及在广告、影视、非遗等领域的应用,领先于Midjourney、DALL-E等竞品。
- 51次使用
查看更多
相关文章
-
- Golangmap实践及实现原理解析
- 2022-12-28 505浏览
-
- 试了下Golang实现try catch的方法
- 2022-12-27 502浏览
-
- Go语言中Slice常见陷阱与避免方法详解
- 2023-02-25 501浏览
-
- Golang中for循环遍历避坑指南
- 2023-05-12 501浏览
-
- Go语言中的RPC框架原理与应用
- 2023-06-01 501浏览