Hugo + Go 1.11 hype thread


#1

So Go 1.11 is near its release. What I’m really expecting:

What about you?


Variable not globally nested, variable cannot be applied with if func
#2

This is great !

Now that we are all used to Scratch for variable manipulation though, I’m wondering if, solely with Go Template (after 1.11) you can just as conviently as with Scratch do the following tasks:

  • Add
  • SetInMap

#3

Scratch will still be very useful (one example is slice appending to create JSON search indexes), but these constructs will be less stupid:

{{ $color := "blue" }}
{{ if .IsHome }}
{{ $color := "orange" }}
{{ end }}

#4

Yes. will wil still need := even to overwrite though?


#5

I have no idea, but it doesn’t really matter for the sake of this discussion.


#6

No, it would be =.


[SOLVED] Scoping a variable outside of and if statement (or two)
#7

Go 1.11 is released
https://golang.org/doc/go1.11


#8

I know. Can’t wait to get rid of those scratches!


#9

Scratch is so much more than overwriting variables though :slight_smile:


#10

I know, I know! But it hurts each time I have to use it to modify a variable… was referring to those scratches :slight_smile: