gizak / termui

Golang terminal dashboard
MIT License
13.07k stars 783 forks source link

Install failed on Go 1.11 with `go mod` turned on #196

Closed cospotato closed 5 years ago

cospotato commented 5 years ago

go version

go version go1.11 darwin/amd64

go env

GOARCH="amd64"
GOBIN="/Users/CosPotato/go/bin"
GOCACHE="/Users/CosPotato/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/CosPotato/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

What have I done

go get -u github.com/gizak/termui

What I Got

# github.com/gizak/termui
../../../go/pkg/mod/github.com/gizak/termui@v2.3.0+incompatible/render.go:107:30: too many arguments in call to stack.ParseDump
        have (*bytes.Reader, *os.File, bool)
        want (io.Reader, io.Writer)
../../../go/pkg/mod/github.com/gizak/termui@v2.3.0+incompatible/render.go:112:15: undefined: stack.Aggregate
../../../go/pkg/mod/github.com/gizak/termui@v2.3.0+incompatible/render.go:112:33: gs.Goroutines undefined (type []stack.Goroutine has no field or method Goroutines)
covertbert commented 5 years ago

I'm having the same issues! 2.2.0 works fine but 2.3.0 throws the error you have above. I can confirm that it's an error that only occurs when using go modules as with a project that's in my gopath it works fine.

cjbassi commented 5 years ago

go get -u github.com/gizak/termui@master should fix it. There's some breaking changes in master fyi.

Similar issue to #177. The issue there is that we needed to use the master branch of https://github.com/maruel/panicparse, so we specified that with dep which fixed that issue. However, it doesn't seem like go modules respects gopkg.lock and defaults to using the latest tag of panicparse. However, we've since dropped panicparse from our master branch, so specifying that branch with go get solves the problem. Dependency management with go can be quite fun :D

I am curious how this would need to be fixed if we hadn't dropped panicparse tho. Adding go module support should fix it, but I'm curious if vendoring our dependencies would fix this too.

covertbert commented 5 years ago

Dependency management kinda sucks in Go I feel your pain!

Cheers for the fix though, it seems to all be working mostly as expected when using the master branch although for some reason my line graph, previously working fine in v2.2.0, is now right-aligning the data points within the axes, so there's basically whitespace between the Y axis and the first data point.

Probably not worth me raising in a separate issue as I guess the master branch is still "beta" but I'll see if I can figure out what's causing it myself

cospotato commented 5 years ago

go get -u github.com/gizak/termui@master should fix it. There's some breaking changes in master fyi.

Similar issue to #177. The issue there is that we needed to use the master branch of https://github.com/maruel/panicparse, so we specified that with dep which fixed that issue. However, it doesn't seem like go modules respects gopkg.lock and defaults to using the latest tag of panicparse. However, we've since dropped panicparse from our master branch, so specifying that branch with go get solves the problem. Dependency management with go can be quite fun :D

I am curious how this would need to be fixed if we hadn't dropped panicparse tho. Adding go module support should fix it, but I'm curious if vendoring our dependencies would fix this too.

Appreciate for your solution! Fixed!

bgadrian commented 5 years ago

Maybe you could bump the version to 2.3.1 so the fix will be permanent? As in the suggested command from the readme will get the latest version.

This issue should be still open, it still happens!

cjbassi commented 5 years ago

Just wanted to come back to this and say that the readme has been updated so that the recommended installation method is to install from master and using the latest release is unsupported, so people should (hopefully) not run into this issue anymore. Also, I'm currently reworking a lot of stuff and haven't created a new release because of the constant breaking changes.

divan commented 5 years ago

I also bumped into this error and it took time to figure out that it's something with termui, and not my setup. +1 for bumping up version to 2.3.1