# Rename refactorings

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/help/go/2026.3/llms.txt).

> **TL;DR**
> Shortcut: `Shift+F6` (Windows), `⇧ F6` (macOS), `⇧ F6` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ R` (macOS System Shortcuts), `Shift+F6` (XWin), `Shift+F6` (GNOME), `Shift+F6` (KDE), `Shift+F6` (Emacs), `Shift+F6` (Sublime Text), `⇧ F6` (Sublime Text (macOS)), `F2` (VSCode), `F2` (VSCode (macOS))
>
>
>
> Main menu: `Refactor | Rename`
>
>
>
> Context menu: `Rename`
>
>
>
> [General refactoring settings](code-editing.html): `Settings | Editor | Code Editing`

Use the Rename refactoring to change names of symbols, files,    and all the references to them throughout code.

Renaming local variables or private methods can be done easily inline since only the limited scope is affected. Renaming types, interfaces, or public methods could potentially impact a lot of files. Preview potential changes before you refactor.

> **Tip:**
> When you rename methods that are declared in interfaces, you can also review and rename their implementations as well. The refactoring changes are displayed on the Refactoring Preview tab in the Find tool window.

Procedure: Rename code in place

1. In the editor start renaming a parameter, a method, or other   code element. GoLand will display ![the Rename the usages of icon](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.suggestedRefactoringBulb.svg) in the gutter.

2. Click the gutter icon or press `Alt+Enter` (Windows), `⌥ ⏎` (macOS), `⌥ ⏎` (IntelliJ IDEA Classic (macOS)), `⌥ ⏎` (macOS System Shortcuts), `Alt+Enter` (XWin), `Alt+Enter` (GNOME), `Alt+Enter` (KDE), `Alt+Enter` (Emacs), `Alt+Enter` (Sublime Text), `⌥ ⏎` (Sublime Text (macOS)), `Ctrl+.` (VSCode), `⌘ .` (VSCode (macOS)) and apply a suggestion.

![Rename inline](https://resources.jetbrains.com/help/img/idea/2026.3/go_rename_inline.png)

GoLand renames the code element and updates its usages accordingly.

![Rename refactoring result](https://resources.jetbrains.com/help/img/idea/2026.3/go_rename_result.png)

Procedure: Rename code in place with inlay hint

1. In the editor, find the code element you want to rename.

2. Edit the text of the code element you want to rename, GoLand will display the Rename usages inlay hint.

3. Select the inlay hint.

![Go code element renamed](https://resources.jetbrains.com/help/img/idea/2026.3/go_code_element_renamed.png)

Procedure: Rename a code element

1. In the editor, select the element you want to rename. If you need to rename a file, select one in the Project tool window.

2. Press `Shift+F6` (Windows), `⇧ F6` (macOS), `⇧ F6` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ R` (macOS System Shortcuts), `Shift+F6` (XWin), `Shift+F6` (GNOME), `Shift+F6` (KDE), `Shift+F6` (Emacs), `Shift+F6` (Sublime Text), `⇧ F6` (Sublime Text (macOS)), `F2` (VSCode), `F2` (VSCode (macOS)) or right-click and select `Rename` from the context menu.

When you invoke the rename `Shift+F6` (Windows), `⇧ F6` (macOS), `⇧ F6` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ R` (macOS System Shortcuts), `Shift+F6` (XWin), `Shift+F6` (GNOME), `Shift+F6` (KDE), `Shift+F6` (Emacs), `Shift+F6` (Sublime Text), `⇧ F6` (Sublime Text (macOS)), `F2` (VSCode), `F2` (VSCode (macOS)) action, GoLand displays ![the Rename in comments and strings icon](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.codeInsight.inlayRenameInComments.svg) and ![the Rename in text occurrences icon](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.codeInsight.inlayRenameInNoCodeFiles.svg) next to the highlighted element.

![Rename variable](https://resources.jetbrains.com/help/img/idea/2026.3/go_rename_var.png)

You can press `Ctrl+Alt+Shift+N` (Windows), `⌘ ⌥ O` (macOS), `⌘ ⌥ ⇧ N` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ O` (macOS System Shortcuts), `Ctrl+Alt+Shift+N` (XWin), `Ctrl+Alt+Shift+N` (GNOME), `Ctrl+Alt+Shift+N` (KDE), `Ctrl+Alt+Shift+N` (Emacs), `Ctrl+Shift+R` (Sublime Text), `⌘ ⇧ R` (Sublime Text (macOS)), `Ctrl+T` (VSCode), `⌘ T` (VSCode (macOS)) to open the context menu and select the additional rename options.

![Additional Rename options](https://resources.jetbrains.com/help/img/idea/2026.3/go_additional_rename_options.png)

If you want to see the Rename dialog with more options, click the More options link or press `Shift+F6` (Windows), `⇧ F6` (macOS), `⇧ F6` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ R` (macOS System Shortcuts), `Shift+F6` (XWin), `Shift+F6` (GNOME), `Shift+F6` (KDE), `Shift+F6` (Emacs), `Shift+F6` (Sublime Text), `⇧ F6` (Sublime Text (macOS)), `F2` (VSCode), `F2` (VSCode (macOS)).

3. You can perform the [rename refactoring in-place](#inplace_rename)  or press `Shift+F6` (Windows), `⇧ F6` (macOS), `⇧ F6` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ R` (macOS System Shortcuts), `Shift+F6` (XWin), `Shift+F6` (GNOME), `Shift+F6` (KDE), `Shift+F6` (Emacs), `Shift+F6` (Sublime Text), `⇧ F6` (Sublime Text (macOS)), `F2` (VSCode), `F2` (VSCode (macOS)) again to open the [Rename](null) dialog. Enter a new name of the element to enable the Preview and Refactor buttons.

![The Rename dialog](https://resources.jetbrains.com/help/img/idea/2026.3/go_rename_dialog.png)

You can specify additional options. For example, specify where to search for element occurrences, or what else to rename. You can also specify a scope for the refactoring.

4. In the Refactoring Preview dialog, review potential changes and click Refactor.

![The refactoring dialog](https://resources.jetbrains.com/help/img/idea/2026.3/go_rename_refactoring.png)

Next time you invoke the Rename refactoring, GoLand remembers the options you have specified inside the Rename dialog.

> **Note:**
> You cannot rename the `.idea` project directory since GoLand always reads the project files from the directory with that exact name.

> **Tip:**
> If you need to edit variables rather than to change them completely, go to `Settings | Editor | Code Editing` and clear the Preselect current symbol name for Rename refactoring checkbox located in the Refactorings section.

Procedure: Rename methods in interfaces

You can rename methods that are declared in interfaces. When you rename the method, GoLand displays a context menu where you can select to rename method implementations as well.

1. Right-click a method in an interface and select `Refactor | Rename`. Alternatively, place the caret at the method in the interface and press `Shift+F6` (Windows), `⇧ F6` (macOS), `⇧ F6` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ R` (macOS System Shortcuts), `Shift+F6` (XWin), `Shift+F6` (GNOME), `Shift+F6` (KDE), `Shift+F6` (Emacs), `Shift+F6` (Sublime Text), `⇧ F6` (Sublime Text (macOS)), `F2` (VSCode), `F2` (VSCode (macOS)).

2. In the context menu, select what you want to rename. To rename the method and all implementations, select Rename method specification and all implementations. To rename only the selected method, select Rename only current method.

3. Type the new name in the editor and press `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `Enter` (VSCode), `⏎` (VSCode (macOS)).

To use the Rename dialog instead, press `Shift+F6` (Windows), `⇧ F6` (macOS), `⇧ F6` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ R` (macOS System Shortcuts), `Shift+F6` (XWin), `Shift+F6` (GNOME), `Shift+F6` (KDE), `Shift+F6` (Emacs), `Shift+F6` (Sublime Text), `⇧ F6` (Sublime Text (macOS)), `F2` (VSCode), `F2` (VSCode (macOS)) again before you finish editing the name. In the dialog, enter the new name and click Refactor, or click Preview to review the changes first. The dialog also opens when in-place renaming is disabled.

![Rename methods in interfaces](https://resources.jetbrains.com/help/img/idea/2026.3/go_rename_method_in_interface.png)

Procedure: Rename packages

1. Place the caret on the package name in a `package` declaration and press `Shift+F6` (Windows), `⇧ F6` (macOS), `⇧ F6` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ R` (macOS System Shortcuts), `Shift+F6` (XWin), `Shift+F6` (GNOME), `Shift+F6` (KDE), `Shift+F6` (Emacs), `Shift+F6` (Sublime Text), `⇧ F6` (Sublime Text (macOS)), `F2` (VSCode), `F2` (VSCode (macOS)).

2. Enter the new package name and review the available options. Click Preview to check the affected declarations and references, then apply the refactoring.

If the directory name matches the package name, GoLand asks whether to rename the directory too. If you have saved a choice for this prompt, GoLand uses that choice.

Procedure: Rename a module

1. Open `go.mod`, place the caret on the module path in the `module` directive, and select `Refactor | Rename`. Alternatively, press `Shift+F6` (Windows), `⇧ F6` (macOS), `⇧ F6` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ R` (macOS System Shortcuts), `Shift+F6` (XWin), `Shift+F6` (GNOME), `Shift+F6` (KDE), `Shift+F6` (Emacs), `Shift+F6` (Sublime Text), `⇧ F6` (Sublime Text (macOS)), `F2` (VSCode), `F2` (VSCode (macOS)).

2. In the Rename dialog, enter the new module path and click Refactor. Alternatively, click Preview to check the affected module-path references and imports in the project.

![Rename Go modules names](https://resources.jetbrains.com/help/img/idea/2026.3/go_rename_go_modules_names.png)

