# Hugo 0.48 will be \>= Go 1.11 Only

**URL:** <https://discourse.gohugo.io/t/hugo-0-48-will-be-go-1-11-only/13826>\
**Category:** Announcements\
**Created:** [August 25, 2018, 5:29pm UTC](https://discourse.gohugo.io/t/hugo-0-48-will-be-go-1-11-only/13826 "2018-08-25T17:29:08Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [August 25, 2018, 5:29pm UTC](https://discourse.gohugo.io/t/hugo-0-48-will-be-go-1-11-only/13826/1 "2018-08-25T17:29:08Z")

</div>

Go 1.11 was released last night and I’m in the process of upgrading the Hugo repo. We will also replace Go Dep with the new built-in Go Modules. This will enable us to update to Blackfriday v2.

But this also means that until Go 1.12 arrives, the current promise about “Hugo builds with the last 2 Go versions” does not apply.

Does anyone have any objections to the above?

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [August 25, 2018, 5:34pm UTC](https://discourse.gohugo.io/t/hugo-0-48-will-be-go-1-11-only/13826/2 "2018-08-25T17:34:28Z")

</div>

And for those who have not read the release notes for Go 1.11 the two big items for Hugo is:

- Variable re-assignment in Go templates. This is a big, big deal and can evaporate lots of ugly Scratch.Set constructs.
- Go modules. Really fantastic dependency manager that is now built into the go command. Implemented by Russ Cox, one of the top smartest IT brains in this universe. It supports running multiple major versions of the same module (Blackfriday1 and 2).

---

<div class="post-metadata">

**Author:** ![kaushalmodi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/kaushalmodi/32/2567_2.png) [@kaushalmodi](https://discourse.gohugo.io/u/kaushalmodi)\
**Post date:** [August 25, 2018, 5:38pm UTC](https://discourse.gohugo.io/t/hugo-0-48-will-be-go-1-11-only/13826/3 "2018-08-25T17:38:04Z")

</div>

> [@bep](#):
>
> Does anyone have any objections to the above?

Nope!

---

<div class="post-metadata">

**Author:** ![gaetawoo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/gaetawoo/32/16789_2.png) [@gaetawoo](https://discourse.gohugo.io/u/gaetawoo)\
**Post date:** [August 25, 2018, 6:08pm UTC](https://discourse.gohugo.io/t/hugo-0-48-will-be-go-1-11-only/13826/4 "2018-08-25T18:08:16Z")

</div>

sounds good, what’s new/benefit in Blackfriday v2?

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [August 25, 2018, 6:18pm UTC](https://discourse.gohugo.io/t/hugo-0-48-will-be-go-1-11-only/13826/5 "2018-08-25T18:18:35Z")

</div>

> [@gaetawoo](#):
>
> sounds good, what’s new/benefit in Blackfriday v2?

BF2 in itself not so much, but it enables us to fix some stuff. I have some plans to create a proper “content data structure” with sections like Footnotes, Headers (I make this up now as I write) and possibly some more in the future. This should enable creating proper ToC and … whatever. It also lays the foundation for more renderers (not just HTML). So we can render content per output format etc. (Latex, Epub).

---

<div class="post-metadata">

**Author:** ![rdwatters](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rdwatters/32/2848_2.png) [@rdwatters](https://discourse.gohugo.io/u/rdwatters)\
**Post date:** [August 25, 2018, 6:28pm UTC](https://discourse.gohugo.io/t/hugo-0-48-will-be-go-1-11-only/13826/6 "2018-08-25T18:28:47Z")

</div>

> [@bep](#):
>
> Does anyone have any objections to the above?

In consideration of…

> [@bep](#):
>
> Variable re-assignment in Go templates. This is a big, big deal and can evaporate lots of ugly Scratch.Set constructs.

…how could anyone have any objections? The only objection is that I’m finally getting good with `.Scratch`…

@gaetawoo, might want to check out the following, which I’m also looking forward to, as I think it will remove a lot of CSS- and JS-based hacks people are doing to work around the default behavior of `#TableOfContents`. Awesome, @bep:

> <https://github.com/gohugoio/hugo/issues/5087>
>
> Go 1.11 is right around the corner. With that comes Go modules, which should sol…ve the versioning issues we currently have with an upgrade to Blackfriday v2. I have started some investigations in another project. 
> 
> The goal of this first "sprint" is to
> 
> 1. Upgrade to BF2 in a way that makes it easy to plug in some hooks that we have described in other issues (URL rewriter etc.), allow for renderer per output format etc (HTML, LatEx ...).
> 2. Add some proper data structures for table of contents and foot notes
> 
> This issue discusses 2) Above.
> 
> For ToC we currently have this HTML \`.TableOfContents\` blob. We cannot remove that over night so I suggest we add a new "container" in Page that contains Markdown-related metadata.
> 
> \* Name? \`.MD.TableOfContents\`?
> 
> That object will in the first go contain two data structures:
> 
> \* \`.TableOfContents\`
> \* \`.Footnotes\`
> 
> For \`TableOfContents\`, I suggest a list of:
> 
> \`\`\`bash
> Title
> Children
> Parent
> \`\`\`
> 
> For \`Footnotes\` I suggest a list of:
> 
> \`\`\`
> ID
> Link
> \`\`\`
> 
> Instead of \`Link\` maybe we should just reuse the term \`RelPermalink\` etc.
> 
> Note that the \`Footnotes\` list is meant to be used to render "somewhere else" in a template, so we also need a way to not render it in the main content.

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [August 25, 2018, 6:44pm UTC](https://discourse.gohugo.io/t/hugo-0-48-will-be-go-1-11-only/13826/7 "2018-08-25T18:44:41Z")

</div>

@rdwatters note that my thinking about “toc and footnotes” have evolved a little since I created the issue above. It is now even cooler.

---

<div class="post-metadata">

**Author:** ![rdwatters](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rdwatters/32/2848_2.png) [@rdwatters](https://discourse.gohugo.io/u/rdwatters)\
**Post date:** [August 25, 2018, 6:45pm UTC](https://discourse.gohugo.io/t/hugo-0-48-will-be-go-1-11-only/13826/8 "2018-08-25T18:45:36Z")

</div>

> [@bep](#):
>
> It is now even cooler.

I’m not surprised 😄 Looking forward to seeing what’s next. Thanks!

---

<div class="post-metadata">

**Author:** ![alexandros](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@alexandros](https://discourse.gohugo.io/u/alexandros)\
**Post date:** [August 25, 2018, 6:52pm UTC](https://discourse.gohugo.io/t/hugo-0-48-will-be-go-1-11-only/13826/9 "2018-08-25T18:52:19Z")

</div>

> [@rdwatters](#):
>
> The only objection is that I’m finally getting good with `.Scratch` …

So do I. But if we can do without it, it’s for the best.

No objections from me @bep

---

<div class="post-metadata">

**Author:** ![rdwatters](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rdwatters/32/2848_2.png) [@rdwatters](https://discourse.gohugo.io/u/rdwatters)\
**Post date:** [August 25, 2018, 6:59pm UTC](https://discourse.gohugo.io/t/hugo-0-48-will-be-go-1-11-only/13826/10 "2018-08-25T18:59:29Z")

</div>

> [@alexandros](#):
>
> The only objection is that I’m finally getting good with `.Scratch` …

I was kidding 😉 @alexandros

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/totallyinformation/32/5668_2.png) [@TotallyInformation](https://discourse.gohugo.io/u/TotallyInformation)\
**Post date:** [August 25, 2018, 8:49pm UTC](https://discourse.gohugo.io/t/hugo-0-48-will-be-go-1-11-only/13826/11 "2018-08-25T20:49:17Z")

</div>

> [@bep](#):
>
> Does anyone have any objections to the above?

Nope! I don’t use GoLang anyway, just the exe version. Go for it.

---

<div class="post-metadata">

**Author:** ![regis](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/regis/32/4958_2.png) [@regis](https://discourse.gohugo.io/u/regis)\
**Post date:** [August 26, 2018, 2:09am UTC](https://discourse.gohugo.io/t/hugo-0-48-will-be-go-1-11-only/13826/12 "2018-08-26T02:09:27Z")

</div>

Can’t wait refactoring all those conditionals without Scratch.

---

<div class="post-metadata">

**Author:** ![kaushalmodi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/kaushalmodi/32/2567_2.png) [@kaushalmodi](https://discourse.gohugo.io/u/kaushalmodi)\
**Post date:** [August 26, 2018, 6:56am UTC](https://discourse.gohugo.io/t/hugo-0-48-will-be-go-1-11-only/13826/13 "2018-08-26T06:56:17Z")

</div>

I couldn’t wait either 😉

> **[Use the new Go Templ variable re-assignment operator = (go 1.11) (e1bbbb00) ·...](https://gitlab.com/kaushalmodi/hugo-theme-refined/commit/e1bbbb00568361920710fee64892a89d5aaf4436)**
>
> Ref: https://github.com/golang/go/commit/28c1ad9d35f27b3b57afff4ee78faac746a8ed0a

---

<div class="post-metadata">

**Author:** ![Shadow53](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/shadow53/32/3018_2.png) [@Shadow53](https://discourse.gohugo.io/u/Shadow53)\
**Post date:** [August 26, 2018, 7:07pm UTC](https://discourse.gohugo.io/t/hugo-0-48-will-be-go-1-11-only/13826/14 "2018-08-26T19:07:55Z")

</div>

> [@bep](#):
>
> Variable re-assignment in Go templates. This is a big, big deal and can evaporate lots of ugly Scratch.Set constructs.

This doesn’t mean that Scratch is disappearing though, right? I have some partials that use Scratch for passing multiple values back to the template calling the partial.

Otherwise, no objections. Looking forward to seeing more improvements in Hugo!

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [August 26, 2018, 7:10pm UTC](https://discourse.gohugo.io/t/hugo-0-48-will-be-go-1-11-only/13826/15 "2018-08-26T19:10:23Z")

</div>

> [@Shadow53](#):
>
> This doesn’t mean that Scratch is disappearing though, right?

Scratch will live – and will still have plenty of use cases that this particular “new thing” does not help with.

---

<div class="post-metadata">

**Author:** ![yarko](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/yarko/32/664_2.png) [@yarko](https://discourse.gohugo.io/u/yarko)\
**Post date:** [August 28, 2018, 6:06pm UTC](https://discourse.gohugo.io/t/hugo-0-48-will-be-go-1-11-only/13826/16 "2018-08-28T18:06:13Z")

</div>

I’m trying to build a new version of Hugo (have just built from github for… at least past year).  
I’m having problems w/ mage (lots of issues building it’s update); lots of this kind of thing:

```auto
# runtime
/usr/local/go/src/runtime/map.go:64:2: bucketCntBits redeclared in this block
	previous declaration at /usr/local/go/src/runtime/hashmap.go:64:18
/usr/local/go/src/runtime/map.go:65:2: bucketCnt redeclared in this block
	previous declaration at /usr/local/go/src/runtime/hashmap.go:65:23
/usr/local/go/src/runtime/map.go:69:2: loadFactorNum redeclared in this block
	previous declaration at /usr/local/go/src/runtime/hashmap.go:69:18

```

…  
I updated to go-1.11. Am I missing something simple?

---

<div class="post-metadata">

**Author:** ![alexandros](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@alexandros](https://discourse.gohugo.io/u/alexandros)\
**Post date:** [August 28, 2018, 6:18pm UTC](https://discourse.gohugo.io/t/hugo-0-48-will-be-go-1-11-only/13826/17 "2018-08-28T18:18:41Z")

</div>

The transition to Go 1.11 is half way through. See:

> <https://github.com/gohugoio/hugo/issues/5115>

---

<div class="post-metadata">

**Author:** ![kaushalmodi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/kaushalmodi/32/2567_2.png) [@kaushalmodi](https://discourse.gohugo.io/u/kaushalmodi)\
**Post date:** [August 28, 2018, 7:10pm UTC](https://discourse.gohugo.io/t/hugo-0-48-will-be-go-1-11-only/13826/18 "2018-08-28T19:10:42Z")

</div>

> [@yarko](#):
>
> Am I missing something simple?

Yep, set `GO111MODULE` to `"on"` [Here’s my [full build script](https://ptpb.pw/SWnP/bash)].

Also ensure that you have the latest `mage` installed.

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [August 28, 2018, 7:37pm UTC](https://discourse.gohugo.io/t/hugo-0-48-will-be-go-1-11-only/13826/19 "2018-08-28T19:37:09Z")

</div>

Also, you really don’t need Mage if you just want to build the Hugo binary. A working way would be to:

1. Install Go 1.11
2. Clone Hugo outside of GOPATH (i.e. to /usr/bep/dev/hugo or something
3. cd /usr/bep/dev/hugo
4. go install

(no need to set GO111MODULE once you’re not inside GOPATH)

---

<div class="post-metadata">

**Author:** ![kaushalmodi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/kaushalmodi/32/2567_2.png) [@kaushalmodi](https://discourse.gohugo.io/u/kaushalmodi)\
**Post date:** [August 28, 2018, 7:40pm UTC](https://discourse.gohugo.io/t/hugo-0-48-will-be-go-1-11-only/13826/20 "2018-08-28T19:40:55Z")

</div>

> [@bep](#):
>
> make install

You mean `mage install`, right? So before step 4, `go get -u -v github.com/magefile/mage` would be needed (if latest `mage` not already installed)?

[Next page](https://discourse.gohugo.io/t/hugo-0-48-will-be-go-1-11-only/13826.md?page=2)
