Goland is a tool developed by INTELLIJ company to develop Golang. Because I am a heavy IntelliJ company's product users, almost used its production, Goland once launched, I developed golang the preferred IDE.
If you have previously used IntelliJ idea to develop Java programs, then using the Goland IDE is almost seamless and straightforward. The Project organization structure, shortcut keys, and so on both can be generalized.
I have previously summed up some techniques for using IntelliJ idea. Part of the Goland under the same application, here will not repeat, the following only summarizes some of the Goland under the specific section.
The comment ("//") is not displayed at the beginning of the line, but is automatically indented with the code.
Under Goland, annotations are at the beginning of the line by default, and they do not provide the option to modify the comment style.
Image.png
You can resolve this issue by modifying the configuration file:
The first step: Export the configuration file under Code Style, Go.
Image.png
Open the configuration file and add the following statement:
<code_scheme name="Default" version="173"> <codeStyleSettings language="go"> <indentOptions> <option name="USE_TAB_CHARACTER" value="false" /> </indentOptions> <!-- 添加下面4行 --> <option name="LINE_COMMENT_AT_FIRST_COLUMN" value="false" /> <option name="BLOCK_COMMENT_AT_FIRST_COLUMN" value="false" /> <option name="LINE_COMMENT_ADD_SPACE" value="true" /> <option name="KEEP_FIRST_COLUMN_COMMENT" value="false" /> </codeStyleSettings></code_scheme>
After saving, import into Goland:
Image.png
This way the comment will not be at the beginning of the line every time:
Image.png