Visual Studio Code build Golang (Go Language) development environment under MAC OS X

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed. [Introduction]
Common Network Name:Pig Head Three
Date of birth: 1981.XX. Xx
Personal website: http://www.x86asm.com
QQ Communication: 643439947
Email:643439947@qq.com
Programming Career: 2001 ~ Present [Total 15]
Career: 13
Development languages: C + +, 80x86asm, PHP, Perl, Objective-c, Object Pascal, C #, Python
Development tools: Visual Studio, Delphi, XCode, Eclipse
Skill type: Reverse Drive Disk File
Research and Development: Windows application software Security/windows System kernel Security/windows system disk data security
Project experience: Disk performance optimization/file system data recovery/File information acquisition/sensitive file monitoring/tracking/network security detection

[Preface]
Since the go language, the only thing that's bothering me is the lack of a strong go language development environment. Hard to support for a long time, Visual Studio Code 1.0.0 release was released. and has the perfect go language integration plug-in, but also the perfect support for the Go language debugging. This makes me extremely excited, later writing go language is not a kind of life-threatening behavior.

[Disclaimer]
1>This article is not only intended for use in Windows systems, but also for Mac OS X systems. But the focus of the article is on the deployment of Mac OS x systems in the environment.
2>MAC OS x related technology sharing, I will not take the free mode, if you are reading this article, encounter difficulties and want to get the next step of technology, you can contact me and pay a fee to obtain the corresponding technical support.
Note: Windows users are free mode
3>Because the go language belongs to Google products, to ensure that you can successfully deploy the Go Language development environment, please prepare your own relevant "scientific Internet technology."

[start to build a development environment with the ability to debug go language]
Step 1:Go to the official Go language website: https://golang.org/Download the installation package for the operating system version. Special Note: Mac OS x system users, be careful to configure the "Gopath" environment variable, otherwise you will not be able to successfully deploy.
Step 2:Go to https://www.visualstudio.com/zh-cn/products/code-vs.aspx website to download visual Studio code
Step 3:Start deploying visual Studio code's Go language extension. Refer to the following article:
Http://www.cnblogs.com/JerryNo1/p/5412864.html
Note: This article applies to Windows users, Mac OS x users (self-adapting)

[Important Feature: Let visual Studio code support go language debugging in Mac OS x system]
Step 1:Open terminal to enter the following command, install the Go Language debugging tool "delve"
Go get-v-u github.com/peterh/liner github.com/derekparker/delve/cmd/dlv
After this thing is installed, will appear in your Gopath/bin directory "DLV" execution file, in the GOPATH/SRC directory appears dlv source file directory: Github.com/derekparker/delve
Step 2:Although the Go Language debugging tool "Delve" is installed, visual Studio code cannot activate this debugging tool to debug the go language because the debugging tool does not have code signing. Therefore, we need to solve this problem by the following important steps:
If you English good can read the original description: https://github.com/derekparker/delve/wiki/Building
if the English is not good, then look at my rough translation:
2.1>Open Keychain Access
2.2>Open Menu Keychain Access/Certificate Assistant/Create Certificate ...
2.3>Name: Dlv-cert identity Type: Self-signed certificate certificate type: Code signing and select "Let me override these defaults"
2.4>Click "Continue", validity period (days): 365 Here you can modify yourself, I changed to 3650
2.5>Go all the way until you see the "Specify a location for this certificate" keychain select System and click the Create button
2.6>After restarting the system, turn on Keychain access, select System, and you will see the created "Dlv-cert" certificate.
2.7>Right-click the "Dlv-cert" certificate, select "Show Info", "trust", "code signing" modified to: Always trust
2.8>Open terminal and then CD command to enter the "DLV source file directory under the GOPATH/SRC directory: Github.com/derekparker/delve" before you install it!
2.9>Enter the following command: go15vendorexperiment=1 cert=dlv-cert make install so you can recompile a DLV executable with code signing

With the 9 steps above, you can complete the environment deployment of "Enable visual Studio code to support go language debugging on Mac OS x systems."

[end and attach]

The above operation is done in Mac OS X v10.11.4 version. If you are unable to deploy successfully in the details, please imitate it multiple times. You may also pay a certain technical support fee in accordance with my [statement] section.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.