“Gin”的版本间的差异

来自linux中国网wiki
跳到导航 跳到搜索
第13行: 第13行:
  
 
== install Gin package==
 
== install Gin package==
 
+
  export PATH=/usr/local/go/bin/:$PATH
 +
  export GOPATH=/root/go #if U user is root
 
=== If you're in China===
 
=== If you're in China===
 
<pre>
 
<pre>
第22行: 第23行:
  
 
  go get -u github.com/gin-gonic/gin
 
  go get -u github.com/gin-gonic/gin
 +
 +
=Use a vendor tool like Govendor=
 +
  go get github.com/kardianos/govendor
 +
sudo apt  install govendor # apt
 +
 +
mkdir -p $GOPATH/src/github.com/myusername/project && cd "$_"
 +
 +
==Vendor init your project and add gin ==
 +
<pre>
 +
govendor init
 +
govendor fetch github.com/gin-gonic/[email protected]
 +
</pre>

2020年6月4日 (四) 06:29的版本

install

pre install golang

Golang

#apt 
#可以指定版本的
sudo apt install  golang

sudo apt  install golang-go gccgo-go
sudo apt  install golang-go 

install Gin package

 export PATH=/usr/local/go/bin/:$PATH
 export GOPATH=/root/go #if U user is root 

If you're in China

go env -w GO111MODULE=on
go env -w GOPROXY=https://mirrors.aliyun.com/goproxy/,direct


go get -u github.com/gin-gonic/gin

Use a vendor tool like Govendor

 go get github.com/kardianos/govendor
sudo apt  install govendor # apt 
mkdir -p $GOPATH/src/github.com/myusername/project && cd "$_"

Vendor init your project and add gin

govendor init
govendor fetch github.com/gin-gonic/[email protected]