vscode上的go-lang发生错误,未能产生EPERM

时间:2020-02-07 04:51:45

标签: windows go visual-studio-code

我正在使用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": []
        }   
    ]
}

0 个答案:

没有答案