Can't compile modified version of Hugo [SOLVED]

I began to read the codebase of Hugo to get a better understanding of how it works and used the trial and error method to see changes. While doing this I was wondering why nothing happend.

Therefore I’ve modified this codeline which will definitively outputs an error message if no config file can be found.

I’m working on Ubuntu 15.04 and Go 1.3.3. To compile the binary I used the following steps:

  1. My working directoy is the Hugo repo
  2. The source code is the same as Git’s HEAD (so no modifications except the error message)
  3. Yes my $GOPATH is set (checked with echo $GOPATH)
  4. I compile main.go with go build main.go
  5. Now I run the compiled binary via ./main
  6. The Hugo repo doesn’t contain a config file and I should see my custom error message from above. BUT that’s not the case.

Please try Go 1.4.2 or 1.5 instead. A few things have changed with the standard library.

It’s also the case that due to the way Go imports things it may be importing $GOPATH/src/ instead of $GOPATH/src/

The best way I’ve found to work around that is to add the digitalcraftsman as a remote to the spf13/hugo repo and pull it into there.

Beside updating to a newer version of Hugo I got it finally running. The reason, as you wrote, that I didn’t thought about the import paths.

With your work around it should work fine. Thanks for the help.