src-d / enry

A faster file programming language detector
https://blog.sourced.tech/post/enry/
Apache License 2.0
460 stars 51 forks source link

Update README.md #211

Closed suhaibmujahid closed 5 years ago

suhaibmujahid commented 5 years ago
go get gopkg.in/src-d/enry.v1/...: unrecognized import path "gopkg.in/src-d/enry.v1/..." (parse https://gopkg.in/src-d/enry.v1/...?go-get=1: no go-import meta tags ())
bzz commented 5 years ago

Thank you for the patch @SuhaibMujahid! What do you think about changing it as in https://github.com/src-d/enry/pull/211#discussion_r271303916 ?

suhaibmujahid commented 5 years ago

Thank you @bzz for consideration.

I tried it but it didn't work:

go get gopkg.in/src-d/enry.v1/cmd/enry: invalid module path "gopkg.in/src-d/enry.v1/cmd/enry"

I'm trying to use enry as a dependency in my application and the modification that I proposed worked for me.

Have a good day :)

creachadair commented 5 years ago

I tried it but it didn't work:

go get gopkg.in/src-d/enry.v1/cmd/enry: invalid module path "gopkg.in/src-d/enry.v1/cmd/enry"

I'm trying to use enry as a dependency in my application and the modification that I proposed worked for me.

Hmm, that error surprises me. What version of Go are you currently building with (go version)?

suhaibmujahid commented 5 years ago

I'm using go1.11.5 darwin/amd64with versioned modules.

creachadair commented 5 years ago

Thanks. I am unfortunately having some trouble reproducing this issue right now. Here's what I tried—if you run this locally does it work?

# Acquire Go 1.11.5
go get golang.org/dl/go1.11.5
go1.11.5 download
# …
go1.11.5 clean -modcache

# First, let's try it without modules.
rm $GOPATH/bin/enry
env -u GO111MODULE go1.11.5 get gopkg.in/src-d/enry.v1/cmd/enry
# works OK
enry -version
# undefined (OK)

# Now let's try it with modules enabled.
rm $GOPATH/bin/enry
mkdir testing ; cd testing ; go mod init testing
env GO111MODULE=on go1.11.5 get gopkg.in/src-d/enry.v1/cmd/enry
enry -version
# undefined (OK)
suhaibmujahid commented 5 years ago

After running clean -modcache it worked.

go get gopkg.in/src-d/enry.v1/cmd/enry
# go: downloading gopkg.in/src-d/enry.v1 v1.7.2
# go: downloading gopkg.in/toqueteos/substring.v1 v1.0.2
# go: downloading github.com/toqueteos/trie v1.0.0
enry -version
# undefined

Thank you.

creachadair commented 5 years ago

Thanks. I suspect you might have had a broken module hash somewhere from an earlier 1.11 build (cf. https://github.com/golang/go/issues/27093).