Summary Goland Tips for use

Source: Internet
Author: User

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
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.