Closed mweinelt closed 3 years ago
Based on your error messages, it seems like you are using Go 1.16 in the legacy GOPATH mode rather than in the current Go Modules mode. Because GOPATH mode doesn't understand versioning, it's unable to distinguish between HCL version 1 and HCL version 2, and so it's failing to access what looks to be a HCL version 1 dependency.
Looks like you are hitting https://github.com/hashicorp/hcl/issues/449
Using Go Modules for dependency resolution should fix this. That's probably also the reason why neither I nor Travis encountered this issue.
Go 1.11 on Debian 10. Can go for 1.14 in backports and retry.
1.11 is fine, because it already has support for go modules. You just need to set the GO111MODULE
environment variable because it's not the default behaviour :)
go: cannot find main module; see 'go help modules'
with GO111MODULE
set to on
.
go get -v -u github.com/fleaz/CptHook
Using go1.14 from bpo I get the same hcl printer problem, even with GO114MODULE=on
.
github.com/fleaz/CptHook (download)
github.com/dustin/go-humanize (download)
github.com/sirupsen/logrus (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/spf13/viper (download)
github.com/fsnotify/fsnotify (download)
github.com/hashicorp/hcl (download)
github.com/agext/levenshtein (download)
github.com/apparentlymart/go-textseg (download)
github.com/mitchellh/go-wordwrap (download)
github.com/zclconf/go-cty (download)
get "golang.org/x/text/unicode/norm": found meta tag get.metaImport{Prefix:"golang.org/x/text", VCS:"git", RepoRoot:"https://go.googlesource.com/text"} at //golang.org/x/text/unicode/norm?go-get=1
get "golang.org/x/text/unicode/norm": verifying non-authoritative meta tag
golang.org/x/text (download)
get "golang.org/x/text/transform": found meta tag get.metaImport{Prefix:"golang.org/x/text", VCS:"git", RepoRoot:"https://go.googlesource.com/text"} at //golang.org/x/text/transform?go-get=1
get "golang.org/x/text/transform": verifying non-authoritative meta tag
package github.com/hashicorp/hcl/hcl/printer: cannot find package "github.com/hashicorp/hcl/hcl/printer" in any of:
/usr/lib/go-1.14/src/github.com/hashicorp/hcl/hcl/printer (from $GOROOT)
/usr/local/go/src/github.com/hashicorp/hcl/hcl/printer (from $GOPATH)
github.com/magiconair/properties (download)
github.com/mitchellh/mapstructure (download)
github.com/pelletier/go-toml (download)
github.com/spf13/afero (download)
github.com/spf13/cast (download)
github.com/spf13/jwalterweatherman (download)
github.com/spf13/pflag (download)
github.com/subosito/gotenv (download)
get "gopkg.in/ini.v1": found meta tag get.metaImport{Prefix:"gopkg.in/ini.v1", VCS:"git", RepoRoot:"https://gopkg.in/ini.v1"} at //gopkg.in/ini.v1?go-get=1
gopkg.in/ini.v1 (download)
get "gopkg.in/yaml.v2": found meta tag get.metaImport{Prefix:"gopkg.in/yaml.v2", VCS:"git", RepoRoot:"https://gopkg.in/yaml.v2"} at //gopkg.in/yaml.v2?go-get=1
gopkg.in/yaml.v2 (download)
github.com/lrstanley/girc (download)
@mweinelt The variable is still called GO111MODULE in go-1.14. For me it is working with go-1.14 and GO111MODULE=on
.
Right, setting GO111Modules: on
in YAML got me GO111MODULES=True
, and go wasn't too happy about that.
Next up, I am now supposed to specify a GOCACHE
path.
build cache is required, but could not be located: GOCACHE is not defined and neither $XDG_CACHE_HOME nor $HOME are defined
After that things are working.
Fuck YAML.