Using the Generate action
The Generate constructor action generates a function that creates values of a struct type. For more information about constructors, see Constructors and composite literals from the Effective Go manual.
Place the caret at your code, and press AltInsert. Alternatively, you can use intention actions AltEnter.
In the Generate window, select Generate constructor.
In the Select Fields dialog, select fields that you want to use in the constructor.
Click OK.
Gif
You can generate getters and setters separately or use one action to generate both methods. For more information about constructors, see Getters from the Effective Go manual.
Place the caret at your code, and press AltInsert. Alternatively, you can use intention actions AltEnter.
In the Generate window, select Getter and setter.
To implement an interface in Go, you need to implement all the methods that are listed in the interface. In GoLand, you can automatically generate templates for those methods.
With the Implement Methods action, you can specify parameter names even if they are omitted in the interface definition.
Place the caret at your code, and press AltInsert.
In the Generate window, select Implement Methods ( or press Ctrl0I).
In the Choose Type window, select the type that you want to use. Alternatively, click Create Type to create a new type.
In the Choose interface to implement field, type a name of the interface that you want to implement.
Replace the
panic("implement me")
line with a code for the method.
Place the caret at your code, and press AltInsert.
In the Generate window, select Empty test file.

tip
A file with the _test.go suffix is created.
Place the caret at your code, and press AltInsert.
In the Generate window, select Tests for file, Tests for package, or Test for function.
You can now generate tests for functions with generic parameters.
Press CtrlAlt0S to open the IDE settings and then select Editor | Copyright | Copyright Profiles.
Click the Add icon
.
In the Create Copyright Profile dialog, type a name for a copyright profile.
In the Copyright text (may contain Velocity templates) field, create or modify a copyright template.
Click OK.
Place the caret at your code, and press AltInsert.
In the Generate window, select Copyright.
tip
For more information about Velocity templates, see documentation for the Apache Velocity Project.
Thanks for your feedback!