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

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (3 by maintainers)

Most upvoted comments

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?

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 … 😉