The jetbrain Goland code template, go file comment, and function description template are missing. This tutorial adds comment template to improve work efficiency.

Set the package template

Go to Settings ->Editor->File and Code Template, as shown in the figure

Setting the Package template

/**
  @author: ${USER}
  @since: ${DATE}
  @desc: //TODO
**/
package ${GO_PACKAGE_NAME}

Copy the code

Apply save again, create a new go file, the effect is as follows.

/**
  @author: stone
  @since: 2021/7/7
  @desc: //TODO
**/
package db
Copy the code

2. Generate function comments

If you’re looking for a lot of tutorials on the Internet, you’ll find that you’re using Settings ->Editor->Live Templates. You can search for tutorials if you have ideas. Today we are installing a plug-in to help us generate function comments.

The name of this plug-in is Goanno, which is the plug-in below. Just install it.

It’s simple to use.

  • For distinguished Mac users, use the control+commend+/ key combination on top of the function
  • For plainer Windows users, use the control+window+/ combination on top of the function

The effect is as follows.


Hey, man, don’t panic! Leave a like and comment. Welcome to gothing, the practical Go language column, to learn go hand in hand. Also welcome to pay attention to me, must do a long more good man.