4 ms·
That's not all! Try inserting a Go variable within a script tag, and Go will automatically convert it to JSON. Makes it possible to easily do this: let msgs
by hellcow 9y ago
That's not all! Try inserting a Go variable within a script tag, and Go will automatically convert it to JSON. Makes it possible to easily do this:
let msgs = {{ .Messages }}
Where .Messages is any slice. Same is true for structs -> JS objects.