Home > Backend Development > Golang > Detailed explanation of golang.org/x one-click installation script

Detailed explanation of golang.org/x one-click installation script

藏色散人
Release: 2021-02-28 16:21:26
forward
3247 people have browsed it

The following is the tutorial column of golang to introduce the golang.org/x one-click installation script. I hope it will be helpful to friends in need!

golang.org/xOne-click installation script

Background

Due to various problems, go get is used to install golang official package in China It may fail. For example, when I installed collidermain myself, the following error occurred:

$ go get collidermain
package golang.org/x/net/websocket: unrecognized import path 
"golang.org/x/net/websocket" (https fetch: Get https://golang.org/x/net/websocket?go-get=1: 
dial tcp 216.239.37.1:443: i/o timeout)
Copy after login

Principle

In fact, golang has established a mirror library on github, such as https:// github.com/golang/net is the mirror library of https://golang.org/x/net

Get the golang.org/x/net package. In fact, it only The following steps are required:

mkdir -p $GOPATH/src/golang.org/x
cd $GOPATH/src/golang.org/x
git clone https://github.com/golang/net.git
Copy after login

This method can be used to obtain other packages under golang.org/x.

So I wrote a bash script here to install the golang.org/x package with one click

  • Windows user git-bash to execute the gox.sh script
  • *unix users firstchmod ##During the process of running the script, if git clone is too frequent, you need to enter your GitHub account.

The above is the detailed content of Detailed explanation of golang.org/x one-click installation script. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:learnku.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template