[Solved] Error while building with Go 1.6.3


I’m trying to build Hugo in version 20 and 20.1 (I haven’t tried 20.2 yet) as I’m building rpm packages.

Anyway, I get the following error when I do it for Centos7 (go 1.6.3)
commands/gendocshelper.go:61: enc.SetIndent undefined (type *json.Encoder has no field or method SetIndent)

Is that normal for that version of golang ? Meaning I can’t build for Centos7 ?
Is there a known fix ?

You can check the code to build there : https://github.com/daftaupe/hugo-rpms/blob/master/SPECS/hugo.spec
and the result there : https://copr-be.cloud.fedoraproject.org/results/daftaupe/hugo/epel-7-x86_64/00540696-hugo/build.log.gz

Thanks !

Hugo supports the 2 latest Go versions (currently that is Go 1.8 and Go 1.7). I’m fairly confident that you can get one of those installed on Centos7.

It seems that Go 1.7 is only available in the Centos Plus repo, thank you for helping me :slightly_smiling: @bep

I now have to check if it’s the same for Fedora 24.