This is a built-in template used each time you create
a new Go file, by selecting New | Go | Go File from the popup menu in one of the project views. The template is editable. Here you can use predefined variables (listed below) that will then be expanded like macros into the corresponding values. It is also possible to specify an arbitrary number of custom variables in the format ${<VARIABLE_NAME>}. In this case, before the new file is created, you will be prompted with a dialog where you can define particular values for all custom variables. Using the #parse directive, you can include templates from the Includes tab, by specifying the full name of the desired template as a parameter in quotation marks. For example: #parse("File Header.go") |
Predefined variables will take the following values: | ||
|
name of the package in which the new file is created if it's just regular file and package + '_test' suffix if the new file is a test file | |
|
name of the package in which the new file is created | |
|
current user system login name | |
|
current system date | |
|
current system time | |
|
current year | |
|
current month | |
|
first 3 letters of the current month name. Example: Jan, Feb, etc. | |
|
full name of the current month. Example: January, February, etc. | |
|
current day of the month | |
|
current hour | |
|
current minute | |
|
the name of the current project |