go - How do I set GODEBUG environment variables in Golang so I can use godebug with net/http -
i want step through program using godebug. because i'm using net/http errors such as:
/home/heath/go/src/net/http/h2_bundle.go:45:2: not import golang_org/x/net/http2/hpack (cannot find package "golang_org/x/net/http2/hpack" in of: /home/heath/go/src/golang_org/x/net/http2/hpack (from $goroot)
/x/net/http2/hpack exist in gopath in ~heath/go/src/golang.org ... not golang_org (not sure what's happening there)
i have read error occurs because godebug doesn't support http2 yet (can't find source).
i have tried disable http2server , http2client setting godebug env both in init() , on command line. have confirmed these settings being set doing fmt.println("godebug", os.getenv("godebug"). per instructions located here
godebug=http2client=0 # disable http/2 client support godebug=http2server=0 # disable http/2 server support
my simple code example replicate error is:
package main import "fmt" import "net/http" import "os" func init() { os.setenv("godebug", "http2server=0,http2client=0") } func main() { fmt.println("godebug", os.getenv("godebug")) _ = "breakpoint" fmt.println("hello, world!") http.listenandserve(":8080", nil) } godebug run example.go
i running go version:
go version go1.7 linux/amd64
this not correct way things. copied http2 package vendor directory under $goroot/src/vendor src directory under $gopath/src.
if has further input on correct way reference vendor directories please add thoughts. putting workaround here in case else comes across same issue.
edit: 'nicer' way things ln -s ..src/vender/github_org ../src/github_org
Comments
Post a Comment