InterfaceDeclaration
Go interface declaration.
Properties for creating an interface declaration.
This can be used for both named and anonymous interfaces.
For named interfaces, use InterfaceTypeDeclarationProps
instead.
import { InterfaceDeclaration } from "@alloy-js/go";
<InterfaceDeclaration refkey={Refkey} singleLine> {children}</InterfaceDeclaration>
import { InterfaceDeclaration } from "@alloy-js/go/stc";
InterfaceDeclaration({ refkey: Refkey, singleLine: boolean,}).children(children)
children | optionalChildren |
refkey | optionalRefkey |
singleLine | optionalboolean Whether to render the interface in a single line.
This will only compile if |
Example
Section titled “Example”<InterfaceDeclaration> <InterfaceEmbed>{MyOtherInterface}</InterfaceEmbed> <InterfaceFunction name="MyFunc" parameters={params} returns="int" /></InterfaceDeclaration>
This will produce:
interface { MyOtherInterface func MyFunc(param Param) int}