在Debian上安裝Golang依賴,你可以使用以下步驟:
sudo apt-get update
sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:longsleep/golang-backports
sudo apt-get update
sudo apt-get install -y golang-go
go version
現在你已經成功在Debian上安裝了Golang。接下來,你可以使用go get
命令來安裝Golang依賴。例如,要安裝github.com/gin-gonic/gin
這個庫,你可以運行:
go get -u github.com/gin-gonic/gin
這將會下載并安裝gin
庫及其依賴。你可以在你的Go項目中導入這個庫并開始使用它。
注意:如果你需要安裝特定版本的依賴,可以在go get
命令中指定版本號,例如:
go get -u github.com/gin-gonic/gin@v1.7.4