gizak / termui

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

Cannot find package "github.com/gizak/termui/v3" #231

Closed sspaink closed 5 years ago

sspaink commented 5 years ago

When I run go get github.com/gizak/termui/v3 I get the error that it cannot find the package in $GOROOT or $GOPATH. Although the folder "\src\github.com\gizak\termui" is created. If I run go get github.com/gizak/termui I don't get any errors and the folder is still created. I am able to run the examples after changing the imports to remove "/v3". Was there a name change and does the README just need to be updated?

Hopefully this isn't just something wrong with my setup. I'm using go version 1.12

Full output: > go get github.com/gizak/termui/v3 package github.com/gizak/termui/v3: cannot find package "github.com/gizak/termui/v3" in any of: C:\Go\src\github.com\gizak\termui\v3 (from $GOROOT) D:\Go_Workspace\src\github.com\gizak\termui\v3 (from $GOPATH)

cjbassi commented 5 years ago

I get this error too. Seems like go get github.com/gizak/termui/v3 doesn't work when run against GOROOT, and only works in a Go module. But doing go get is kindof redundant with Go modules since Go auto resolve packages based on the imports used. I'm wondering if we can just remove the installation command. Is there any reason to install termui globally? Maybe for legacy non-module applications, idk.

cjbassi commented 5 years ago

I just updated the installation instructions for using termui in a Go module. Let me know if there's any issues with the instructions.

sspaink commented 5 years ago

Thank you for the update! The instructions are clear.

fridim commented 5 years ago

I have the same issue as described here.

I looked at https://github.com/gizak/termui/commit/6d201dcdd2594e83e4d57c483e7550df449f5505 but i can't make it work. I tried go 1.10.8 and 1.12.1

cjbassi commented 5 years ago

@fridim Installing termui with Go modules only works for Go >= 1.11. Can you try creating a new go module project (go mod init foo) outside of your GOROOT, and testing the hello_world example?

raypereda commented 5 years ago

@cjbassi As you suggested, I created a new module project outside of GOROOT, and tested the hello_world example. I can verify that it works using Go 1.12.1 linux. Thanks for the clear documentation.