Updating source repos to fix dependency errors when building Hugo

Since I spent some time unsuccesffuly building Hugo as the result of dependency source code errors I share this tip to fix them.

In my case it had been many months since my last build and some dependent source reposititories were not updated with the go get or go build command.

In this case you’ll get a bunch of “undefined” errors. When go sees you have the repo source code folder apparently it doesn’t necesarily check to see if has been updated to a newer version that hugo may be using.

The solution (other than deleting and cloneing those repos) is to use this version of the go get command supplied by @spf13 . Steve says it will update all dependent repos including those not within spf13

go get -u github.com/spf13/hugo

here is the original topics that elicited this tip

1 Like

just a followup note. If for some reason your local hugo git repo master branch is not tracking the remote origin branch you’ll have to set that up in git to get this update to work without balking.

Having bumped into this a couple of times, you also need to be on master when you do this; you can’t be on a different branch.