Export adds an export to the module This is the core method that handles all types of exports including default For default export, use name="default" Deprecated: Use ExportValue or ExportLiteral for declarative, reusable module definitions.
(name string, value *Value)
| 46 | // For default export, use name="default" |
| 47 | // Deprecated: Use ExportValue or ExportLiteral for declarative, reusable module definitions. |
| 48 | func (mb *ModuleBuilder) Export(name string, value *Value) *ModuleBuilder { |
| 49 | var spec ValueSpec |
| 50 | if value != nil { |
| 51 | spec = contextValueSpec{value: value} |
| 52 | } |
| 53 | return mb.ExportValue(name, spec) |
| 54 | } |
| 55 | |
| 56 | // ExportValue adds an export ValueSpec to the module. |
| 57 | func (mb *ModuleBuilder) ExportValue(name string, spec ValueSpec) *ModuleBuilder { |