一只放羊的 2020-03-26 14:46 采纳率: 0%
浏览 757
已结题

goland开启服务器报错socket: operation not permitted

linux系统;
当我运行

import (
    //_ "myproject/routers"
    "fmt"
    "net/http"
)

func IndexHandler(w http.ResponseWriter,req *http.Request){
    fmt.Fprintln(w, "hello world")
}

func main() {
    //beego.Run()
    http.HandleFunc("/hello",IndexHandler)
    err:=http.ListenAndServe("127.0.0.1:8080",nil)
    if err!=nil{
        panic(err)
    }
}

报错listen tcp :8080: socket: operation not permitted

  • 写回答

2条回答 默认 最新

  • threenewbee 2020-03-26 16:42
    关注

    看看是不是端口占用或者防火墙造成的。

    评论

报告相同问题?

悬赏问题

  • ¥20 求计算赫斯特(Hurst)指数
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大