-
-
Notifications
You must be signed in to change notification settings - Fork 20
Build Template interfaces.
Cheikh Seck edited this page Sep 12, 2017
·
1 revision
- Click on
Interfaces
within your project tree.
- Click on the yellow save button or use (ctrl-s | cmd-s)
- Multi-purpose text field. Text used to search for an interface and new interface name.
- Click on the button with the
+
(plus) symbol to create a new interface ( with multi-purpose field filled). - Click on the button with search symbol to search for an interface ( with multi-purpose field filled). You can always use (ctrl-f | cmd-f)
The <struct/>
tag will declare a new Go interface within within your generated Go src.
- name - The name of this structure
- Innerxml - Struct field declarations.
The example below declares a Go struct named DemoGos with a sub structure called DemoChild. The struct DemoGos has attributes SomeAttr and Child.
Whenever this interface is initialized within a template ({{ $var := Struct_name }}
), these variables are accessible as that interface's properties.
<gos>
...
<struct name="DemoChild">
SomeOtherAttr string
</struct>
<struct name="DemoGos">
SomeAttr string
Child *DemoChild
</struct>
...
</gos>
Template init with prior example : {{ $var := DemoGos }}