草庐IT

net_error

全部标签

google-app-engine - 应用引擎/去 : 'goapp serve' giving an error "Go application could not be built" error

我正在尝试将Go与适用于Go的AppEngineSDK一起使用,当我运行goappserve时,在转到http://localhost:8080后打印浏览器时出现以下错误(我在终端中遇到类似的错误):TheGoapplicationcouldnotbebuilt.(Executedcommand:C:\go_appengine\goroot\bin\go-app-builder.exe-app_baseC:\Projects\Go\Davilex-arch6-dynamic-gorootC:\go_appengine\goroot-nobuild_files^^$-unsafe-gop

elasticsearch - go + elastigo panic : runtime error: index out of range

我正在用elasticsearch测试golang我正在使用图书馆:https://github.com/mattbaird/elastigo我的问题是当我运行时:gorunelastigo_postal_code2.go编译器显示如下:panic:runtimeerror:indexoutofrangegoroutine1[running]:panic(0x893ce0,0xc82000a150)/opt/go/src/runtime/panic.go:464+0x3ffmain.main()/home/hector/go/elastigo_postal_code2.go:80+0x

go - 是否可以从 Go 'DNSError' 包访问嵌入在 'OpError' 结构中的 'net' 结构的字段?

我在Go中启动一个SSH客户端连接,我试图在返回错误时访问详细的错误数据。我目前正在使用这段代码:client,err:=ssh.Dial("tcp","unknownserver:22",config)iferr!=nil{ifoerr,ok:=err.(*net.OpError);ok{a:=oerr.Errfmt.Printf("%#v\n",a)}log.Fatal("Failedtodial:"+err.Error())}返回这两行错误数据:&net.DNSError{Err:"nosuchhost",Name:"unknownserver",Server:"",IsTime

macos - 更新到 macOS beta 4 后,go test -cover 抛出 "fatal error: unexpected signal during runtime execution"

Gobuild和gotest仍然有效。在更新到macOSbeta之前,我使用测试覆盖工具没有遇到任何问题。“去测试”工作正常;但是,所有覆盖率测试命令都抛出此错误(gotest-coverprofile=coverage.out抛出相同的问题)。如果有人知道如何解决这个问题,我将不胜感激!$gotest-covergobuildgithub.com/hunteramericano/ErrorQuiver:/usr/local/Cellar/go/1.6.3/libexec/pkg/tool/darwin_amd64/cover:signal:fatalerror:unexpecteds

go - 如何在 Golang 中设置 GODEBUG 环境变量,以便我可以将 godebug 与 net/http 一起使用

我想使用Godebug单步执行我的程序.但是,因为我使用的是net/http,所以出现如下错误:/home/heath/go/src/net/http/h2_bundle.go:45:2:couldnotimportgolang_org/x/net/http2/hpack(cannotfindpackage"golang_org/x/net/http2/hpack"inanyof:/home/heath/go/src/golang_org/x/net/http2/hpack(from$GOROOT)/x/net/http2/hpack确实存在于我的GOPATH中,但存在于~heath/

go - 从 net/html 获取完整的标签/行号

使用html.Parse(rio.Reader)解析文档后,我们得到一个节点树。每个DOM节点都提供它的环境、标签的名称和该标签的属性。Seehere.从节点对象到文件r中该节点的字符串文本以及该文件中该标记的行号的最佳方法是什么? 最佳答案 html包没有记录那个信息,所以不可用。 关于go-从net/html获取完整的标签/行号,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/

pointers - 使用 xlsx 包 panic : runtime error: invalid memory address or nil pointer dereference Go

var(file*xlsx.Filesheet*xlsx.Sheetrow*xlsx.Rowcell*xlsx.Cell)funcaddValue(valstring){cell=row.AddCell()cell.Value=val}并从http://github.com/tealeg/xlsx导入当控制权到达这条线时cell=row.AddCell()这是panic。错误:panic:runtimeerror:invalidmemoryaddressornilpointerdereference有人可以建议这里出了什么问题吗? 最佳答案

http - ListenAndServe 返回 net.DNSError "nodename nor servname provided"

我正在尝试编写一个gohttp服务器,但是当我尝试收听传入连接时遇到问题。硬件设置:MacOSSierra10.12.4,docker17.03我有一个yml文件可以打开一个.phpmyadmin和sql:mysql:extends:service:mysql-5.7ports:-"3306:3306"phpmyadmin:image:phpmyadmin/phpmyadmin:latestlinks:-"mysql:db"ports:-"8080:80"这似乎工作正常。之后我写了一个go文件来连接和监听连接:stack:=negroni.New()stack.Use(cors.New

docker - "golang.org/x/net/ipv4"在 Mac 上工作,但在 Linux 上不工作

我正在使用“golang.org/x/net/ipv4”以使用其SetTTL函数。不幸的是,它似乎不能在Linux上运行,只能在Mac上运行,尽管文档表明Linux支持所有功能。这是问题的最小示例,带有Dockerfile:main.go:packagemainimport("fmt""net""bufio"xnet"golang.org/x/net/ipv4")constHost="google.com"funcmain(){varerrerrorconn,err:=net.Dial("tcp4",Host+":80")iferr!=nil{panic(err)}deferconn.

ASP.NET核心显示动作路由参数通过页面上的AngularJS

简而言之,我正在尝试拥有它,以便如果通过Action参数,可以被角捕获,也可以作为变量传递。例如,如果我的路由设置为template:"{action}/{id?}",然后有人来访:localhost/Waitlist/SpringBash(在哪里Waitlist是个action和SpringBash是个id)可以到达一个页面,说:You'reviewingtheSpringBashevent!Event1NameDateEvent2NameDateEvent3NameDate我正在通过ASP.NETCore处理所有路线MapRoute和Startup类,并且不打算转换为AngularJS路由