Skip to content

E0132: A value isn't written as its label ​

A hole's label is the Go of its value — {o.Ref} is filled by o.Ref — so ui.HTML's markup reads as what it shows. The value in this place is other Go than its label says: the values are filled in the order the labels first appear, so a swapped or renamed one shows the wrong thing. Reported by vukavet; spaces and line breaks don't count.

Wrong ​

go
return ui.HTML(`<p>{o.ID}: {o.Ref}</p>`, o.Ref, o.ID)
go
return ui.HTML(`<p>{o.ID}: {o.Ref}</p>`, o.ID, o.Ref)

A value too long to be a label is a variable first:

go
cancel := func() { p.Cancel(o.ID) }
return ui.HTML(`<button onClick={cancel}>Cancel</button>`, cancel)

Released under the MIT License. Vuka builds on Go and its tools, which are made by the Go Authors. Vuka is not affiliated with Google or the Go project. Go is a trademark of Google LLC.