wtf icon indicating copy to clipboard operation
wtf copied to clipboard

go get fails

Open talonx opened this issue 8 years ago • 15 comments

go get github.com/senorprogrammer/wtf
# github.com/senorprogrammer/wtf/gcal
../go/src/github.com/senorprogrammer/wtf/gcal/widget.go:235: duration.Round undefined (type time.Duration has no field or method Round)

go version go1.8.3 linux/amd64

talonx avatar May 31 '18 17:05 talonx

Which version of go do you have installed?

senorprogrammer avatar May 31 '18 17:05 senorprogrammer

Please see the original report - 1.8.3

talonx avatar May 31 '18 17:05 talonx

Go get return the following (same as git clone and then make install):

# github.com/senorprogrammer/wtf/github
go/src/github.com/senorprogrammer/wtf/github/github_repo.go:90:30: pr.RequestedReviewers undefined (type *github.PullRequest has no field or method RequestedReviewers)
go/src/github.com/senorprogrammer/wtf/github/github_repo.go:106:41: too many arguments in call to github.PullRequests.List
	have (context.Context, string, string, *github.PullRequestListOptions)
	want (string, string, *github.PullRequestListOptions)
go/src/github.com/senorprogrammer/wtf/github/github_repo.go:119:47: too many arguments in call to github.Repositories.Get
	have (context.Context, string, string)
	want (string, string)

danielwangksu avatar May 31 '18 18:05 danielwangksu

Same error as @talonx ...

-> % make install
which wtf | xargs rm
go install -ldflags="-X main.version=v0.0.3_`git rev-parse --abbrev-ref HEAD` -X main.date=2018-05-31T12:26:08-0700"
# github.com/senorprogrammer/wtf/gcal
gcal/widget.go:235: duration.Round undefined (type time.Duration has no field or method Round)
make: *** [install] Error 2

go version:

-> % go version
go version go1.8 darwin/amd64

So I decided to troubleshoot...

Upgraded Go via Brew (MacOS):

brew upgrade golang

I was then able to build & run wtf with the following commands:

go get github.com/senorprogrammer/wtf
cd $GOPATH/src/github.com/senorprogrammer/wtf
go build -o wtfutil
./wtfutil

Upgrading go worked for me:

-> % go version
go version go1.10.2 darwin/amd64

Hope this works for others ... 😉

0xdead8ead avatar May 31 '18 19:05 0xdead8ead

maybe my golang is too new? go version go1.10.2 darwin/amd64

danielwangksu avatar May 31 '18 19:05 danielwangksu

For me it is the github/github_repo.go file causing trouble. I'm not sure what is the file for. But the function myReviewRequests(username string) complains about too many variables. It happens in either manually build or using make install

danielwangksu avatar May 31 '18 20:05 danielwangksu

I had a similar issue:

[0][rubiojr@arico] go get github.com/senorprogrammer/wtf
# github.com/senorprogrammer/wtf/github
go/src/github.com/senorprogrammer/wtf/github/github_repo.go:90:30: pr.RequestedReviewers undefined (type *github.PullRequest has no field or method RequestedReviewers)

Using go get -u fixed it for me. I guess it updated some cached dependency or something? wtf doesn't seem to vendor deps, right?

rubiojr avatar May 31 '18 20:05 rubiojr

Thank you @rubiojr, your solution works for me. I forgot there are some other projects I forked before. After go get -u I was able to build it manually as suggested by @f47h3r

danielwangksu avatar May 31 '18 20:05 danielwangksu

@rubiojr You're correct, it doesn't yet vendor deps so if there are earlier versions on your local system, it'll try to use those with potentially mixed results. Definitely an improvement to be made.

senorprogrammer avatar May 31 '18 21:05 senorprogrammer

@senorprogrammer would you like to use golang/dep for that? Happy to open a PR and vendor current dependencies.

rubiojr avatar Jun 03 '18 20:06 rubiojr

Absolutely. I have no experience with that, so please do.

senorprogrammer avatar Jun 04 '18 00:06 senorprogrammer

Opened https://github.com/senorprogrammer/wtf/pull/170

rubiojr avatar Jun 05 '18 18:06 rubiojr

As of this PR by @rubiojr, deps are vendored: https://github.com/senorprogrammer/wtf/pull/170

senorprogrammer avatar Jun 06 '18 16:06 senorprogrammer

I run go get -u github.com/senorprogrammer/wtf Receive this error package github.com/senorprogrammer/wtf: no Go files in /Users/.../go/src/github.com/senorprogrammer/wtf

My version go version go1.10.3 darwin/amd64, I am using a Macbook

phuwin1995 avatar Jun 21 '18 11:06 phuwin1995

If you cd to /Users/.../go/src/github.com/senorprogrammer/wtf is there anything there? If so, is there a wtf.go file in there?

senorprogrammer avatar Jun 21 '18 12:06 senorprogrammer