GoSnippetExecutor extends AbstractSnippetExecutor<GoSnippetExecutorOptions> { protected String formatImportLine(final String importLine) { final String importLineBeginning = "\""; final String importLineEnding = "\""; String formattedImportLine; if (importLine.startsWith(importLineBeginning)) { formattedImportLine = importLine; } else { formattedImportLine = importLineBeginning.concat(importLine); } if (!importLine.endsWith(importLineEnding)) { formattedImportLine = formattedImportLine.concat(importLineEnding); } return formattedImportLine; } GoSnippetExecutor(); @Override Parent getUI(final CodeSnippet codeSnippet); @Override Node getConfigurationUI(); @Override void saveNewOptions(); @Override ObservableList<String> execute(final CodeSnippet codeSnippet);  }
@Test public void formatImportWithoutDoubleQuotes() { assertEquals("\"fmt\"", snippetExecutor.formatImportLine("fmt")); }
@Test public void formatImportWithDoubleQuotes() { assertEquals("\"fmt\"", snippetExecutor.formatImportLine("\"fmt\"")); }