Delete a Type Parameter with an Empty Parameter List

Type parameters with empty parameter lists are reported as errors, but you have a quick-fix in GoLand to put it right.

Tip Screenshot

Type parameters with empty parameter lists are highlighted as errors. So, if you type func printInt[](i int), GoLand will highlight [] because the IDE expects type parameters here. In this case, you can either implement type parameters or delete square brackets. To delete square brackets, try the Delete type parameters quick-fix.

Place the cursor on the empty parameter list ([]), press ⌥⏎ (macOS) / Alt+Enter (Windows/Linux), and select Delete type parameters.


Related Resources

Rename Generic Receivers Along with a Generic Struct
Rename Generic Receivers Along with a Generic Struct
Get refactoring support when you rename a generic struct.
Create a Function in Another Package
Create a Function in Another Package
Type a non-existing function name and generate its implementation in a package of your choice.
Empower your `Printf`-like functions with coding assistance
Empower your `Printf`-like functions with coding assistance
Provide hints and highlights for message formats in custom `Printf`-like functions.