GoLand 2021.1 Help

Change Signature dialog

Refactor | Change Signature

The Change Signature refactoring combines several different modifications that can be applied to a function, method, or a method specification. You can use this refactoring to:

  • change the method name

  • add, remove, and reorder parameters

  • assign default values to new non-variadic parameters

When changing a method signature, GoLand searches for all usages of the method and updates all the calls, implementations, and override replacements of the method that can be safely modified to reflect the change. When you refactor a method specification, you will see a notification dialog where you can select to update all implementations as well.

ItemDescription
NameName of a function, method, or a method specification.
Parameters

List of parameters in the signature. In the Parameters field, you can perform the following actions with parameters:

  • Add The Add icon: Adds a new parameter. You can specify properties of the new parameter in the corresponding table row (a name, type, and a default value).

  • Remove The Remove icon: Removes a parameter.

  • Up The Up icon and Down The Down icon icons: Reorders parameters.

Result parametersReturned or result parameters of a Go function. You can specify properties of the new parameter in the corresponding table row (a name, type, and a default value).
Last modified: 08 March 2021