TL;DR — you don't need to run the second command, just the first one.

I'm sorry for being unclear. Go get looks up packages by their import path. The 
import path of golint is "golang.org/x/lint/golint", so the second command you 
ran with the github URL will never work since that is the repo, not the package 
path. When you run go get golang.org/x/lint/golint it will look up the repo, 
discover that it lives at GitHub, clone it, and build it.

If you don't specify another package import path and you host your source on 
GitHub the github.com url is the default one, which may be why you are 
confused. However, golint specifies a custom import path 
(golang.org/x/lint/golint) so you need to use that.

—Sam

On Wed, Oct 17, 2018, at 14:48, 'kalekold' via golang-nuts wrote:
> I've already tried that and the original command still fails.
> 
> $ go get -u -v golang.org/x/lint/golint
> Fetching https://golang.org/x/lint/golint?go-get=1
> Parsing meta tags from https://golang.org/x/lint/golint?go-get=1 (status 
> code 200)
> get "golang.org/x/lint/golint": found meta tag get.metaImport{Prefix:
> "golang.org/x/lint", VCS:"git", 
> RepoRoot:"https://go.googlesource.com/lint"} 
> at https://golang.org/x/lint/golint?go-get=1
> get "golang.org/x/lint/golint": verifying non-authoritative meta tag
> Fetching https://golang.org/x/lint?go-get=1
> Parsing meta tags from https://golang.org/x/lint?go-get=1 (status code 
> 200)
> golang.org/x/lint (download)
> Fetching https://golang.org/x/lint?go-get=1
> Parsing meta tags from https://golang.org/x/lint?go-get=1 (status code 
> 200)
> get "golang.org/x/lint": found meta tag get.metaImport{Prefix:
> "golang.org/x/lint", VCS:"git", 
> RepoRoot:"https://go.googlesource.com/lint"} 
> at https://golang.org/x/lint?go-get=1
> Fetching https://golang.org/x/tools/go/ast/astutil?go-get=1
> Parsing meta tags from 
> https://golang.org/x/tools/go/ast/astutil?go-get=1 
> (status code 200)
> get "golang.org/x/tools/go/ast/astutil": found meta tag get.metaImport{
> Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:
> "https://go.googlesource.com/tools"} at https:
> //golang.org/x/tools/go/ast/astutil?go-get=1
> get "golang.org/x/tools/go/ast/astutil": verifying non-authoritative 
> meta 
> tag
> Fetching https://golang.org/x/tools?go-get=1
> Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 
> 200)
> golang.org/x/tools (download)
> Fetching https://golang.org/x/tools/go/gcexportdata?go-get=1
> Parsing meta tags from 
> https://golang.org/x/tools/go/gcexportdata?go-get=1 
> (status code 200)
> get "golang.org/x/tools/go/gcexportdata": found meta tag get.metaImport{
> Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:
> "https://go.googlesource.com/tools"} at https:
> //golang.org/x/tools/go/gcexportdata?go-get=1
> get "golang.org/x/tools/go/gcexportdata": verifying non-authoritative 
> meta 
> tag
> Fetching https://golang.org/x/tools/go/internal/gcimporter?go-get=1
> Parsing meta tags from 
> https://golang.org/x/tools/go/internal/gcimporter?go-get=1 
> (status code 200)
> get "golang.org/x/tools/go/internal/gcimporter": found meta tag get.
> metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:
> "https://go.googlesource.com/tools"} at https:
> //golang.org/x/tools/go/internal/gcimporter?go-get=1
> get "golang.org/x/tools/go/internal/gcimporter": verifying non-
> authoritative 
> meta tag
> 
> $ go get -u -v github.com/golang/lint/golint
> github.com/golang/lint (download)
> package github.com/golang/lint/golint: code in directory /media/Data/
> Projects/Go/src/github.com/golang/lint/golint expects import 
> "golang.org/x/lint/golint"
> 
> 
> On Wednesday, 17 October 2018 17:53:50 UTC+1, Sam Whited wrote:
> >
> > As the error says, you need to use golang.org/x/lint/golint: 
> >
> >     go get -u -v golang.org/x/lint/golint 
> >
> > —Sam 
> >
> > On Wed, Oct 17, 2018, at 10:12, gary.wi...@victoriaplumb.com <javascript:> 
> > wrote: 
> > > I'm having trouble installing golint. Any idea what the problem could 
> > be? 
> > > 
> > > $ go get -u -v github.com/golang/lint/golint 
> > > github.com/golang/lint (download) 
> > > package github.com/golang/lint/golint: code in directory 
> > /home/gary/Code/go/ 
> > > src/github.com/golang/lint/golint expects import "
> > golang.org/x/lint/golint" 
> > > 
> > > -- 
> > > You received this message because you are subscribed to the Google 
> > > Groups "golang-nuts" group. 
> > > To unsubscribe from this group and stop receiving emails from it, send 
> > > an email to golang-nuts...@googlegroups.com <javascript:>. 
> > > For more options, visit https://groups.google.com/d/optout. 
> >
> >
> > -- 
> > Sam Whited 
> > s...@samwhited.com <javascript:> 
> >
> 
> -- 
> You received this message because you are subscribed to the Google 
> Groups "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send 
> an email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.


-- 
Sam Whited
s...@samwhited.com

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to