Add header comments to GoLand files

a background

       In order to unify the specification, it is decided to add comments in the project, including the header comments of the file and the comments of the function method. The comment of the function method is easy to say. It took a long time to comment on the header of the file (it was really easy after I finished it), and I recorded the process I made to facilitate others.

Two steps to set the header annotation


       My system environment is Macos, and this article is for GoLand on Mac computers.
2.1 Construct header file comment template

       Open GoLand, select `File And Code Templates` under `GoLand => Prefences => Editor`:

insert image description here


       Select Includes, create a File Headerfile called:

Please add a picture description

       The configuration is as follows:

// Package ${GO_PACKAGE_NAME}
// @Author: Joe.Wu
// @File: ${NAME}.go
// @Date: 

Guess you like

Origin blog.csdn.net/whq19890827/article/details/128009290