02-go语言 go环境 - linux开发环境 - client-go使用-推荐入门- 含推荐官方api文档

go1.18

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

linux go环境基础安装 步骤详细 推荐阅读

https://blog.csdn.net/huang431127/article/details/119574793

推荐国内源:https://blog.csdn.net/qq_42346414/article/details/111151567

go env -w GOPROXY=https://goproxy.cn,direct

安装go环境

原文:https://www.php.cn/be/go/471564.html

第一次linux 成功版本目录结构!!!

[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

linux修改 modle命令

go env -w GO111MODULE=auto
go env -w GO111MODULE=on

下载beego 和安装beego命令

go get github.com/astaxie/beego
go get github.com/beego/bee
cp /root/gopath/bin/bee /usr/local/bin/

kubernetes客户端client-go使用

https://www.jianshu.com/p/48946a317d81

https://blog.csdn.net/huwh_/article/details/78821805

推荐client-go 代码2

https://www.jb51.net/article/220679.htm

用go在github上下载的项目怎样运行它:## 标题

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

你可能感兴趣的:(java-go-微服务SOA,golang,k8s)