While debugging the sample application (github.com/lukehoban/webapp-go/tree/debugging) (I’ve attached a partial screenshot.) The message is “Unable to open ‘server.go’: File not found (c:\Users\rpfister\usr\local\go\src\net\http\server.go).

This seems to be a mishmash of fragments from the local and container paths.
The local file is here: C:\Go\src\net\http\server.go
The container file is here: /usr/local/go/src/net/http/server.go
But it looked here: c:\Users\rpfister\usr\local\go\src\net\http\server.go, which is home on the local machine (C:\Users\rpfister) added to the remote path (\local\go\src\net\http\server.go) to create a path that doesn't exist anywhere.
Additional info:
The local host’s GOROOT is C:\Go.
The local host's GOPATH is C:\Users\rpfister\go.
The container’s GOROOT is /go.
The container's GOPATH is undefined.
To reproduce
Clone the debugging branch of https://github.com/lukehoban/webapp-go/tree/debugging
Change line 1 of Dockerfile from "FROM golang:1.6" to "FROM golang:1.7" (The docker build fails using golang:1.6.)
Change "host": "192.168.99.100" to "host: "localhost" in line 29 of .vscode/launch.json (assuming you are running on the same machine).
Follow instructions in the comments in the launch.json; i.e., run the following two commands from the command prompt.
$ docker build -t webapp-go .
$ docker run -d --name webapp-go --privileged -p 8080:8080 -p 2345:2345 webapp-go
Set breakpoint to line 37 in main.go
Launch the "Remote debug in Docker" debug configuration.
Step over repeatedly until the error is encountered.
Versions in use
Delve
PS C:\Users\rpfister> dlv version
Delve Debugger
Version: 1.0.0-rc.1
Build: $Id: b6077a6a35c48a31716aad2ad3fdf77bbdf70abd $
Golang
PS C:\Users\rpfister> go version
go version go1.8.3 windows/amd64
Docker
PS C:\Users\rpfister> docker version
Client:
Version: 17.06.1-ce
API version: 1.30
Go version: go1.8.3
Git commit: 874a737
Built: Thu Aug 17 22:48:20 2017
OS/Arch: windows/amd64
Server:
Version: 17.06.1-ce
API version: 1.30 (minimum version 1.12)
Go version: go1.8.3
Git commit: 874a737
Built: Thu Aug 17 22:54:55 2017
OS/Arch: linux/amd64
Experimental: true
Visual Studio Code
Visual Studio Code 1.15.1
Commit 41abd21afdf7424c89319dd7cb0445cc6f376959
Date 2017-08-16T18:07:25.676Z
Shell 1.6.6
Renderer 56.0.2924.87
Node 7.4.0
Architecture x64
Go extension (lukehoban.go) 0.6.63, 26th July, 2017
While debugging the sample application (
github.com/lukehoban/webapp-go/tree/debugging) (I’ve attached a partial screenshot.) The message is “Unable to open ‘server.go’: File not found (c:\Users\rpfister\usr\local\go\src\net\http\server.go).This seems to be a mishmash of fragments from the local and container paths.
The local file is here:
C:\Go\src\net\http\server.goThe container file is here:
/usr/local/go/src/net/http/server.goBut it looked here:
c:\Users\rpfister\usr\local\go\src\net\http\server.go, which is home on the local machine (C:\Users\rpfister) added to the remote path (\local\go\src\net\http\server.go) to create a path that doesn't exist anywhere.Additional info:
The local host’s GOROOT is
C:\Go.The local host's GOPATH is
C:\Users\rpfister\go.The container’s GOROOT is
/go.The container's GOPATH is undefined.
To reproduce
Clone the debugging branch of https://github.com/lukehoban/webapp-go/tree/debugging
Change line 1 of Dockerfile from "FROM golang:1.6" to "FROM golang:1.7" (The docker build fails using golang:1.6.)
Change
"host": "192.168.99.100"to"host: "localhost"in line 29 of .vscode/launch.json (assuming you are running on the same machine).Follow instructions in the comments in the launch.json; i.e., run the following two commands from the command prompt.
Set breakpoint to line 37 in main.go
Launch the "Remote debug in Docker" debug configuration.
Step over repeatedly until the error is encountered.
Versions in use
Delve
Golang
Docker
Visual Studio Code
Visual Studio Code 1.15.1
Commit 41abd21afdf7424c89319dd7cb0445cc6f376959
Date 2017-08-16T18:07:25.676Z
Shell 1.6.6
Renderer 56.0.2924.87
Node 7.4.0
Architecture x64
Go extension (lukehoban.go) 0.6.63, 26th July, 2017