这是我的项目结构go
▶ tree -L 2
.
├── cmd
│ ├── app.go
│ ├── canary.go
├── go.mod
├── go.sum
├── lib
│ ├── clisupport
│ ├── fileutils
├── myapp
├── myapp.go
├── pkg
│ ├── app
│ ├── canary
main函数在文件中。myapp.go
我想启动调试会话,因此我使用以下文件launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "myconfig",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceFolder}",
"args": []
}
]
}
但是,当我单击调试按钮时,该过程会崩溃,并带有巨大的痕迹,如下所示:
/Users/pkaramol/go/pkg/mod/golang.org/x/oauth2@v0.0.0-20190604053449-0f29369cfe45/google/default.go:17:2: missing go.sum entry for module providing package cloud.google.com/go/compute/metadata (imported by golang.org/x/oauth2/google); to add:
go get golang.org/x/oauth2/google@v0.0.0-20190604053449-0f29369cfe45
/Users/pkaramol/go/pkg/mod/k8s.io/client-go@v0.16.8/discovery/discovery_client.go:28:2: missing go.sum entry for module providing package github.com/golang/protobuf/proto (imported by k8s.io/client-go/discovery); to add:
go get k8s.io/client-go/discovery@v0.16.8
为什么会失败?
繁星淼淼
相关分类