初始化项目mod go mod init 项目名称(注意:项目名称必须有) 引入gin框架文件 go get -u github.com/gin-gonic/gin 能运行,编辑器爆红 解决方案 go mod vendor