Coder Social home page Coder Social logo

Comments (7)

fleaz avatar fleaz commented on August 22, 2024

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 hashicorp/hcl#449

Using Go Modules for dependency resolution should fix this. That's probably also the reason why neither I nor Travis encountered this issue.

from cpthook.

mweinelt avatar mweinelt commented on August 22, 2024

Go 1.11 on Debian 10. Can go for 1.14 in backports and retry.

from cpthook.

fleaz avatar fleaz commented on August 22, 2024

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 :)

from cpthook.

mweinelt avatar mweinelt commented on August 22, 2024

go: cannot find main module; see 'go help modules'

with GO111MODULE set to on.

go get -v -u github.com/fleaz/CptHook

from cpthook.

mweinelt avatar mweinelt commented on August 22, 2024

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)

from cpthook.

belzebub40k avatar belzebub40k commented on August 22, 2024

@mweinelt The variable is still called GO111MODULE in go-1.14. For me it is working with go-1.14 and GO111MODULE=on.

from cpthook.

mweinelt avatar mweinelt commented on August 22, 2024

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.

from cpthook.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.