Brew Build Problem

brew reinstall --HEAD hugo   

Responds with:

src/github.com/spf13/hugo/watcher/batcher.go:19:2: cannot find package   "gopkg.in/fsnotify.v1"    in any of:
    /usr/local/Cellar/go/1.4.2/libexec/src/gopkg.in/fsnotify.v1 (from $GOROOT)
    /private/tmp/hugo20150410-12229-52fxr7/src/gopkg.in/fsnotify.v1 (from $GOPATH)

I know this is likely related to the go installation process, and I’ve read several threads here and elsewhere about it. None of the proposed adjustments to GOPATH and GOROOT are working for me. I have run brew update && upgrade.

My current version is v0.13-DEV BuildDate: 2015-01-28T19:01:33-06:00, and I’m not having any particular problems with it, so this isn’t urgent; but I’d like to be able to resolve it if anyone can help.

I was able to get past this error by modifying the hugo formula as follows:

diff --git a/Library/Formula/hugo.rb b/Library/Formula/hugo.rb
index 5a9ee5a..fcc564d 100644
--- a/Library/Formula/hugo.rb
+++ b/Library/Formula/hugo.rb
@@ -105,10 +105,9 @@ class Hugo < Formula
     url "https://github.com/yosssi/ace.git",
         :revision => "1f82044938a7180f6fb6bbb3a29688d1e6dbe74b"
   end
-  go_resource "gopkg.in/fsnotify.v0" do
+  go_resource "gopkg.in/fsnotify.v1" do
     url "https://github.com/go-fsnotify/fsnotify.git",
-        :branch => "v0",
-        :revision => "ea925a0a47d225b2ca7f9932b01d2ed4f3ec74f6"
+        :branch => "v1.2.0"
   end
   go_resource "gopkg.in/yaml.v2" do
     url "https://github.com/go-yaml/yaml.git",

I.e. change go_resource to "gopkg.in/fsnotify.v1, change :branch to v1.2.0 and remove :revision.

With that the compilation proceeded past that point, but now I’m getting the following error, any ideas are welcome:

# github.com/spf13/hugo/commands
src/github.com/spf13/hugo/commands/hugo.go:106: undefined: cobra.MousetrapHelpText

cobra.MousetrapHelpText is a recent addition to Cobra (github.com/spf13/cobra). I’m kind of confused about the brew dependency handling.

Yes, I figured out that the MousetrapHelpText was a recent addition. I also bumped into a couple of other recent changes (such as Annotations in pflag that also required updates. I finally got it to work, I have submitted a pull request against the hugo Homebrew formula: https://github.com/Homebrew/homebrew/pull/38662

It’s working now. Thank you very much.