打开setting.json
编辑:
{ "window.zoomLevel": 0, "go.docsTool": "gogetdoc", "go.formatTool": "goimports", "explorer.confirmDelete": false, "go.lintFlags": ["--disable=varcheck", "--enable=errcheck"] }
无用!!! 我C
然后可以根据vscode 提示,来更正你的格式,尤其是参数
比如:
returnjson := json.ReturnJson{Code: 200, Data: nil, Msg: "登录成功"} //这个就不会出现黄色波浪线 ReturnJson(c, returnjson) returnjson := json.ReturnJson{http.StatusAccepted, nil, "登录失败"} //这个会出现