Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hitting weird error on go get #45

Closed
WLun001 opened this issue Nov 18, 2020 · 10 comments
Closed

hitting weird error on go get #45

WLun001 opened this issue Nov 18, 2020 · 10 comments

Comments

@WLun001
Copy link

WLun001 commented Nov 18, 2020

go version
go version go1.15 darwin/amd64
$ go get -u -v github.com/containerd/console


github.com/containerd/console (download)
github.com/containerd/console
# github.com/containerd/console
go/src/github.com/containerd/console/console_unix.go:31:37: undefined: unix.O_RDWR
go/src/github.com/containerd/console/console_unix.go:31:49: undefined: unix.O_NOCTTY
go/src/github.com/containerd/console/console_unix.go:31:63: undefined: unix.O_CLOEXEC
go/src/github.com/containerd/console/console_unix.go:51:12: undefined: unix.Termios
go/src/github.com/containerd/console/console_unix.go:85:32: undefined: unix.Termios
go/src/github.com/containerd/console/tc_darwin.go:27:13: undefined: unix.TIOCGETA
go/src/github.com/containerd/console/tc_darwin.go:28:13: undefined: unix.TIOCSETA
go/src/github.com/containerd/console/tc_unix.go:25:27: undefined: unix.Termios
go/src/github.com/containerd/console/tc_unix.go:34:27: undefined: unix.Termios
go/src/github.com/containerd/console/tc_unix.go:81:18: undefined: unix.Termios
go/src/github.com/containerd/console/console_unix.go:31:63: too many errors

related to gofiber/cli#38

@thaJeztah
Copy link
Member

What version of golang.org/x/sys did it pick? I think this was fixed by #40 (see #39)

@WLun001
Copy link
Author

WLun001 commented Nov 18, 2020

@thaJeztah How to check?

@thaJeztah
Copy link
Member

In the project in which you're using this module, you can run something like;

go list -m all | grep golang.org/x/sys

However, if you're running go get without go modules (using go path), then it may be that you have an outdated version of golang.org/x/sys in your GOPATH, and that it picks that version to build

@WLun001
Copy link
Author

WLun001 commented Nov 18, 2020

@thaJeztah thanks! I had to change directory to project with go modules, only it can go get successfully. I just fresh reinstalled Go, and golang.org/x/sys is on latest commit, still doesn't work outside go modules.

@thaJeztah
Copy link
Member

Thanks! Also tried in a container to verify;

$ docker run -it --rm golang:1.14 bash -c 'mkdir /foo && cd /foo && go get -u github.com/gofiber/cli/fiber && fiber --help'

github.com/gofiber/cli (download)
github.com/fsnotify/fsnotify (download)
get "golang.org/x/sys/unix": found meta tag get.metaImport{Prefix:"golang.org/x/sys", VCS:"git", RepoRoot:"https://go.googlesource.com/sys"} at //golang.org/x/sys/unix?go-get=1
get "golang.org/x/sys/unix": verifying non-authoritative meta tag
golang.org/x/sys (download)
get "golang.org/x/sys/internal/unsafeheader": found meta tag get.metaImport{Prefix:"golang.org/x/sys", VCS:"git", RepoRoot:"https://go.googlesource.com/sys"} at //golang.org/x/sys/internal/unsafeheader?go-get=1
get "golang.org/x/sys/internal/unsafeheader": verifying non-authoritative meta tag
github.com/charmbracelet/bubbles (download)
github.com/charmbracelet/bubbletea (download)
github.com/containerd/console (download)
github.com/muesli/termenv (download)
github.com/lucasb-eyer/go-colorful (download)
github.com/mattn/go-isatty (download)
github.com/mattn/go-runewidth (download)
get "golang.org/x/crypto/ssh/terminal": found meta tag get.metaImport{Prefix:"golang.org/x/crypto", VCS:"git", RepoRoot:"https://go.googlesource.com/crypto"} at //golang.org/x/crypto/ssh/terminal?go-get=1
get "golang.org/x/crypto/ssh/terminal": verifying non-authoritative meta tag
golang.org/x/crypto (download)
get "golang.org/x/term": found meta tag get.metaImport{Prefix:"golang.org/x/term", VCS:"git", RepoRoot:"https://go.googlesource.com/term"} at //golang.org/x/term?go-get=1
golang.org/x/term (download)
github.com/atotto/clipboard (download)
github.com/spf13/cobra (download)
github.com/spf13/pflag (download)
golang.org/x/sys/internal/unsafeheader
github.com/containerd/console/vendor/golang.org/x/sys/internal/unsafeheader
github.com/mattn/go-runewidth
github.com/lucasb-eyer/go-colorful
github.com/containerd/console/vendor/golang.org/x/sys/unix
golang.org/x/sys/unix
github.com/atotto/clipboard
github.com/spf13/pflag
github.com/fsnotify/fsnotify
github.com/mattn/go-isatty
github.com/muesli/termenv
github.com/containerd/console
golang.org/x/term
github.com/spf13/cobra
golang.org/x/crypto/ssh/terminal
github.com/charmbracelet/bubbletea
github.com/charmbracelet/bubbles/spinner
github.com/charmbracelet/bubbles/textinput
github.com/gofiber/cli/cmd/internal
github.com/gofiber/cli/cmd
github.com/gofiber/cli/fiber

🚀 Fiber is an Express inspired web framework written in Go with 💖
Learn more on https://gofiber.io

CLI version 0.0.6

Usage:
  fiber [flags]
  fiber [command]

Available Commands:
  dev         Rerun the fiber project if watched files changed
  help        Help about any command
  new         Generate a new fiber project
  upgrade     Upgrade Fiber cli if a newer version is available
  version     Print the local and released version number of fiber

Flags:
  -h, --help   help for fiber

Use "fiber [command] --help" for more information about a command.

I did see a possible bug in the fiber code; trying to run fiber version after that prints an error;

fiber version: open go.mod: no such file or directory (latest 2.2.0)

@thaJeztah
Copy link
Member

Let me close this one

@kiyonlin
Copy link

I did see a possible bug in the fiber code; trying to run fiber version after that prints an error;

fiber version: open go.mod: no such file or directory (latest 2.2.0)

@thaJeztah Actually the output is expected 😄
fiber version prints the local(version in go module project) and released version number of fiber

@thaJeztah
Copy link
Member

@kiyonlin right, but wondering why it didn't find the go.mod during compile; is it looking in the wrong location if it's fetched when go modules are enabled?

@kiyonlin
Copy link

@thaJeztah That's maybe because fiber version only finds go.mod in current working directory.

@thaJeztah
Copy link
Member

oh, it tries at runtime not during compile? 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants