最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

go語言-在mac下brew升級golang

 更新時間:2021年04月25日 14:31:09   作者:qauzy  
這篇文章主要介紹了go語言-在mac下brew升級golang,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧

在命令行下直接運(yùn)行:

brew upgrade go

補(bǔ)充:mac下更新delve調(diào)試go語言

概述

delve 是golang調(diào)試程序。但如果版本不配套, mac下goland 調(diào)試,step over會不起作用,直接變成執(zhí)行完畢或者到下一個斷點(diǎn)。 需要更新調(diào)試器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 #<Homebrew::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 <main>'
 from /usr/local/Homebrew/Library/Homebrew/brew.rb:30:in `<main>'

這是因?yàn)樽C書有問題。 可以到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環(huán)境

安裝完最新的 delve 后,如 brew install delve, 然后在IntelliJ或goland中點(diǎn)擊

Help → Edit Custom Properties...

添加新行

dlv.path=/usr/local/bin/dlv

保存重啟,解決step over(F8) 直接運(yùn)行完畢的bug。

以上為個人經(jīng)驗(yàn),希望能給大家一個參考,也希望大家多多支持腳本之家。如有錯誤或未考慮完全的地方,望不吝賜教。

相關(guān)文章

  • 基于Go Int轉(zhuǎn)string幾種方式性能測試

    基于Go Int轉(zhuǎn)string幾種方式性能測試

    這篇文章主要介紹了Go Int轉(zhuǎn)string幾種方式測試,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2021-04-04
  • golang struct, map, json之間的相互轉(zhuǎn)換

    golang struct, map, json之間的相互轉(zhuǎn)換

    本文用于記錄我在 golang 學(xué)習(xí)階段遇到的類型轉(zhuǎn)換問題,針對的是 json 、map、struct 之間相互轉(zhuǎn)換的問題,感興趣的可以了解一下
    2021-06-06
  • go語言中的數(shù)組指針和指針數(shù)組的區(qū)別小結(jié)

    go語言中的數(shù)組指針和指針數(shù)組的區(qū)別小結(jié)

    本文主要介紹了go語言中的數(shù)組指針和指針數(shù)組的區(qū)別小結(jié),文中通過示例代碼介紹的很詳細(xì),具有一定的參考價值,感興趣的可以了解一下
    2024-10-10
  • 關(guān)于go-zero單體服務(wù)使用泛型簡化注冊Handler路由的問題

    關(guān)于go-zero單體服務(wù)使用泛型簡化注冊Handler路由的問題

    這篇文章主要介紹了go-zero單體服務(wù)使用泛型簡化注冊Handler路由,涉及到Golang環(huán)境安裝及配置Go Module的相關(guān)知識,本文給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2022-07-07
  • golang 字符串比較是否相等的方法示例

    golang 字符串比較是否相等的方法示例

    這篇文章主要介紹了golang 字符串比較是否相等的方法示例,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2021-02-02
  • 詳解Go語言如何高效解壓ZIP文件

    詳解Go語言如何高效解壓ZIP文件

    在日常開發(fā)中,我們經(jīng)常需要處理 ZIP 文件,本文主要為大家介紹一個使用 Go 語言編寫的高效 ZIP 文件解壓工具,希望對大家有一定的幫助
    2025-03-03
  • go同步原語Phaser和Barrier區(qū)別

    go同步原語Phaser和Barrier區(qū)別

    這篇文章主要為大家介紹了通過java講解go同步原語Phaser和Barrier區(qū)別,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2023-12-12
  • Golang字符串變位詞示例詳解

    Golang字符串變位詞示例詳解

    這篇文章主要給大家介紹了關(guān)于GoLang字符串變位詞的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧。
    2017-10-10
  • Go語言操作MySQL的知識總結(jié)

    Go語言操作MySQL的知識總結(jié)

    Go語言中的database/sql包提供了保證SQL或類SQL數(shù)據(jù)庫的泛用接口,并不提供具體的數(shù)據(jù)庫驅(qū)動。本文介紹了Go語言操作MySQL的相關(guān)知識,感興趣的可以了解一下
    2022-11-11
  • go?集成nacos注冊中心、配置中心的過程詳解

    go?集成nacos注冊中心、配置中心的過程詳解

    這篇文章主要介紹了go集成nacos注冊中心、配置中心的相關(guān)知識,本文給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友參考下吧
    2024-12-12

最新評論

台北市| 龙口市| 施甸县| 周口市| 临泉县| 塘沽区| 侯马市| 临潭县| 疏附县| 兴文县| 东兰县| 酉阳| 韶山市| 宽城| 沧源| 双流县| 卫辉市| 蓬安县| 灌南县| 白沙| 水城县| 高要市| 保靖县| 长阳| 富锦市| 永仁县| 松潘县| 永平县| 蒙阴县| 伊宁县| 峨眉山市| 泾阳县| 兴安县| 奉新县| 麟游县| 贵州省| 泰兴市| 鲜城| 安泽县| 衡水市| 禹州市|