Object References
Object references are specific to Haml syntax. They are not supported by Slim or EGO templates.
An object reference is a special object in Go that can provide either id and/or class attributes to an element.
In this example we used the article value as an object reference to the div element. Here is how this might render out:
The article value we used in the example has implemented the following two methods:
Anything that implements func ObjectID() string can be used to provide an id attribute to an element. Likewise, anything that implements func ObjectClass() string can be used to provide a class attribute to an element.
We can also provide a prefix that will be used for both the class and id attributes.
renders as: