zoukankan      html  css  js  c++  java
  • 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

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

  • 相关阅读:
    pandas中的时间序列基础
    Python中的进程
    Pandas透视表和交叉表
    Pandas分组级运算和转换
    Python中的线程详解
    Pandas聚合
    Python面试题整理
    Pandas分组
    暑假集训 || 动态规划
    DFS || HDU 2181
  • 原文地址:https://www.cnblogs.com/igoodful/p/14060553.html
Copyright © 2011-2022 走看看