Go github.com/gin-gonic/gin 報錯,run不起來解決方法

1.使用其他鏡像資源

go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.io,direct

因爲國內有牆限制,安裝bin包需要使用國內鏡像。搭梯子就直接跳過此步驟

2.在項目目錄下分別執行以下命令

go mod init gin
go mod edit -require github.com/gin-gonic/gin@latest
go mod vendor

OK,這下就run起來了

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章