Go language version test, a homicide caused by an error code


Recently, I was learning to write docker, and saw a piece of code that would compile errors


Recently, I was learning docker and saw a sample code, which will report an error every time I compile it

As a result, we can’t continue, so we have to search for solutions online,
It takes a lot of time to find the code that can run normally:

// cmd.SysProcAttr.Credential = &syscall.Credential{Uid: uint32(1), Gid: uint32(1)}

cmd.SysProcAttr.UidMappings = []syscall.SysProcIDMap{
{ContainerID: 5001, HostID: syscall.Getuid(), Size: 1},
cmd.SysProcAttr.GidMappings = []syscall.SysProcIDMap{
{ContainerID: 5001, HostID: syscall.Getgid(), Size: 1},

However, I don’t think it’s the version difference,
Maybe the author’s Version (1.7.1) will work. My version is (go1.9.1)
There’s a GVM in the collection that can switch versions, so the toss begins


bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)

 ls -al ~/.gvm
 // apt-get install binutils bison gcc make
 gvm  list
 gvm listall
 gvm install go1.7.1 -B
 gvm use go1.7.1
#Common commands

 cd ~/
 git clone [email protected]:golang/go.git
 cd go
 git checkout -b 1.4.3 go1.4.3
 git branch
 cd src
#Compiling environment

cp ~/go ~/go1.4 -rf

gvm install go1.7.1 --source=https://github.com/golang/go


The morning passed like this, and there was harvest after all, so I shared my experience in the group
The big guy said that the general development didn’t use multiple versions, crying over orz

In the sharing of special series articles, it is not easy to code

Please share, please like

This article is published by openwrite, a blog platform with one article and multiple posts!
The latest content is welcome to the official account.
Go language version test, a homicide caused by an error code

Recommended Today

Configure Apache to support PHP in the Apache main configuration file httpd.conf Include custom profile in

In Apache’s main configuration file / conf/ http.conf Add at the bottom Include “D:workspace_phpapache-php.conf” The file path can be any In D: workspace_ Create under PHP file apache- php.conf file Its specific content is [html] view plain copy PHP-Module setup LoadFile “D:/xampp/php/php5ts.dll” LoadModule php5_module “D:/xampp/php/php5apache2_2.dll” <FilesMatch “.php$”> SetHandler application/x-httpd-php </FilesMatch> <FilesMatch “.phps$”> SetHandler application/x-httpd-php-source </FilesMatch> […]