Template template;
GoVarDeclarations[] globalVariables = goFile.getGlobalVariables();
if (globalVariables.length == 0) {
template = createNewStatementTemplate(editor, goFile, startElement);
} else {
GoVarDeclarations lastVar = globalVariables[globalVariables.length - 1];
template = createAppendGlobalVariableTemplate(editor, lastVar, startElement);
}
if (template != null) {
TemplateManager.getInstance(project).startTemplate(editor, template, new TemplateEditingAdapter() {