Break and continue keywords coming to range


#1

Hey everyone,

This is more of Go news than Hugo news but I’m so excited that I decided to share.

I noticed via this GitHub Issue that our very own @bep made, that support for the break and continue keywords in Go Templates has finally been implemented.

It’s set for the Go v1.10 release, which itself is scheduled for January 31, 2018. I can’t wait. Go templating has been difficult for me for a few reasons, this being one of them.


#2

This should be useful for sure.

Dumb question: When something like this gets added to Go, does it automatically get used by Hugo if we build Hugo with that Go, or, does Hugo code have to be added to enable it?


#3

That’s a great question. I don’t know the answer. My assumption is, it depends. I think there might be some features that will just work out of the box, and others that Hugo itself would need to “allow”/implement.

I don’t know the codebase well enough.


#4

This has been pushed back to Go v1.11. :frowning_face:


#5

Yes…


#6

Nice ! Next step switch! :smiley:


#7

Late July 2018 for that milestone, it appears.


#8

So is variable assignment (issue)
Big month for Go template!