go get fails
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
Which version of go do you have installed?
Please see the original report - 1.8.3
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)
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 ... 😉
maybe my golang is too new? go version go1.10.2 darwin/amd64
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
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?
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
@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 would you like to use golang/dep for that? Happy to open a PR and vendor current dependencies.
Absolutely. I have no experience with that, so please do.
Opened https://github.com/senorprogrammer/wtf/pull/170
As of this PR by @rubiojr, deps are vendored: https://github.com/senorprogrammer/wtf/pull/170
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
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?