1 下载 解压
#进入tmp目录下
wget https://golang.google.cn/dl/go1.18.3.linux-amd64.tar.gz
tar -xzvf go1.18.3.linux-amd64.tar.gz
mv go /usr/local/
2 设置环境变量
# 安装目录
export GOROOT=/usr/local/go
# 代码目录
export GOPATH=~/code
export PATH=$GOPATH:$GOROOT/bin:$PATH
source ~/.bashrc
3 验证
go version
https://blog.csdn.net/huang431127/article/details/119574793
go env -w GOPROXY=https://goproxy.cn,direct
原文:https://www.php.cn/be/go/471564.html
[root@test-it-it-alert hello]# pwd
/root/gopath/src/hello # 此目录下执行 go build 编译处理 hello文件!!!棒
[root@test-it-it-alert hello]# tree ../../
../../
├── bin
├── pkg
└── src
├── foo
│ └── foo.go
└── hello
├── hello
└── hello.go
5 directories, 3 files
[root@test-it-it-alert hello]# echo $GOPATH
/root/gopath
[root@test-it-it-alert hello]# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/go/bin
https://www.php.cn/be/go/471564.html
#!/bin/bash
tar -C /usr/local -zxvf go1.16.3.linux-amd64.tar.gz
echo "export PATH=$PATH:/usr/local/go/bin" >> /etc/profile
echo "export GOPATH=/root/gopath" >> /etc/profile
mkdir /root/gopath
mkdir -p /root/gopath/src
mkdir -p /root/gopath/bin
mkdir -p /root/gopath/pkg
source /etc/profile
go version
go env -w GO111MODULE=auto
go env -w GO111MODULE=on
go get github.com/astaxie/beego
go get github.com/beego/bee
cp /root/gopath/bin/bee /usr/local/bin/
https://www.jianshu.com/p/48946a317d81
https://blog.csdn.net/huwh_/article/details/78821805
https://www.jb51.net/article/220679.htm
https://www.xp.cn/c.php/111052.html
安装了go语言,并设置了GOPATH在f盘,在github上下载了primitive的项目:
go get -u github.com/fogleman/primitive
go get github.com/astaxie/beego
go get github.com/beego/bee
然后新建一个文件夹,放入一张照片,打开cmd cd到那个文件 执行:
primitive -i input.png -o output.png -n 100
出现如下提示:
bash: primitive: command not found
怎样运行primitive?
https://blog.csdn.net/saynaihe/article/details/124524579
https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#serviceaccount-v1-core