我正在使用Windows10和vscode。 尝试启动时,我看到以下错误消息:
“无法继续:错误产生EPERM”
这是我的代码和launch.json。
package main
import (
"fmt"
"net/http"
)
//Hello is Http receiver
type Hello struct{}
func (h Hello) ServeHTTP(
w http.ResponseWriter,
r *http.Request) {
fmt.Fprint(w, "Hello!")
}
func main2() {
var h Hello
http.ListenAndServe("localhost:4000", h)
}
这是我的launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${fileDirname}",
"env": {},
"args": []
}
]
}