Non-Project Files Protection dialog
This dialog appears when you try to edit non-project files: SDK sources, external sources and so on. Such files are intentionally protected from modification. For example, it is not recommended that you change Go SDK packages as you are supposed to reuse them as is.
If you want to work with these files, add them to the content root. A content root in GoLand is a folder that contain your source code, build scripts, unit tests, and documentation. In the Project tool window, this folder is marked with the icon.
If you want to edit these files only once without adding them to your project, use one of the options in the dialog:
I want to edit this file anyway: select this option to disable protection for the listed files.
I want to edit all files in this directory: select this option to disable protection for the listed files and all files in the same directory.
I want to edit any non-project file in the current session: select this option to disable protection.
Edit non-project files in the vendor directory
If you need to edit files in the vendor directory, consider adding this directory as a content root to your project. Read more about content roots in the Content root article.
Add the package folder to the content root from editor
Start editing a non-project file.
In the Non-Project Files Protection dialog, select the scope that you want to edit.
In the notification window, click the Add <package> to the project.
Add the package folder to the content root from settings
Open settings by pressing Ctrl+Alt+S and navigate to Project Structure.
Click the Add Content Root button and navigate to the folder that you want to add to the project structure as a content root.