Code is already running!

package main

import (
    "fmt"
    "log"
    "net/http"
)

// w表示response对象,返回给客户端的内容都在对象里处理
// r表示客户端请求对象,包含了请求头,请求参数等等
func index(w http.ResponseWriter, r *http.Request) {
    // 往w里写入内容,就会在浏览器里输出
    fmt.Fprintf(w, "Hello golang http!")
}

func main() {
    // 设置路由,如果访问/,则调用index方法
    http.HandleFunc("/", index)

    // 启动web服务,监听9090端口
    err := http.ListenAndServe(":1080", nil)
    if err != nil {
        log.Fatal("ListenAndServe: ", err)
    }
}

在浏览器上输入:http://localhost:1080/

出现如下图:

#################################################

但是用vscode来运行程序老是出现:Code is already running!

最近使用visual studio 开发,在运行了 run code 之后,再次运行 ,总提示  Code is already running!

最终在输出窗口 :右键 :stop code run

###############################################

原文地址:https://www.cnblogs.com/igoodful/p/14060553.html