GoLand live template custom template failure problem solving

problem background

I want to customize a comment template in goland, input /**+Enter can be completed as shown in the figure below

/**
* @description TODO
* @param null
* @return
* @author user
* @date 2023/7/4 15:24
 */
func main() {
    
    
	print("hello world\n")
}

So I set the following template in File -> Settings -> Live Template,
insert image description here
where the template is filled as follows

/**
* @description TODO
* $params$
* @return $return$
* @author $user$
* @date $data$ $time$
*/

The variable setting is as follows,
insert image description here
but it still fails after setting, and the input /**+Enter is displayed as follows

/**
 
 */
func main() {
    
    
	print("hello world\n")
}

Cause Analysis

The templates customized by GoLand have a higher priority than our own templates. When the template keyword /** conflicts, the templates of GOLand will be used first.

problem solved

I did not find a way to modify GoLand’s custom template after consulting the information, so I can only modify our template
Here we change the keyword /** to /att, which means that after attention,
insert image description here
the test can be tested again after the test is successful.
Input /att+Enter can be completed As shown below

/**
* @description TODO
* @param null
* @return
* @author user
* @date 2023/7/4 15:24
 */
func main() {
    
    
	print("hello world\n")
}

Guess you like

Origin blog.csdn.net/weixin_45271005/article/details/131535950