test_class.file: mvn-golang-wrapper/src/test/java/com/igormaznitsa/mvngolang/GolangBuildMojoTest.java
test_class.identifier: GolangBuildMojoTest
test_case.body: @Test
    public void testPackageTest_Multiple() throws Exception {
      final GolangBuildMojo buildMojo = makeBuildMojo();
      assertTrue(buildMojo.getPackages().length > 1);
      assertThat(asList(buildMojo.getCommandFlags()), not(hasItem("-o")));
      assertThat(asList(buildMojo.getCommandFlags()), not(hasItem(endsWith("targetName"))));
    }
test_case.class_method_signature: GolangBuildMojoTest.testPackageTest_Multiple()
test_case.full_signature: @Test public void testPackageTest_Multiple()
test_case.identifier: testPackageTest_Multiple
test_case.invocations: makeBuildMojo assertTrue getPackages assertThat asList getCommandFlags not hasItem assertThat asList getCommandFlags not hasItem endsWith
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testPackageTest_Multiple()
focal_class.declarator: resultFolder
focal_class.modifier: @Parameter(name = "resultFolder", defaultValue = "${project.build.directory}")
    private
focal_class.original_string: @Parameter(name = "resultFolder", defaultValue = "${project.build.directory}")
    private String resultFolder;
focal_class.type: String
focal_class.var_name: resultFolder
focal_class.declarator: resultName
focal_class.modifier: @Parameter(name = "resultName", defaultValue = "${project.build.finalName}")
    private
focal_class.original_string: @Parameter(name = "resultName", defaultValue = "${project.build.finalName}")
    private String resultName;
focal_class.type: String
focal_class.var_name: resultName
focal_class.declarator: buildMode
focal_class.modifier: @Parameter(name = "buildMode", defaultValue = "default")
    private
focal_class.original_string: @Parameter(name = "buildMode", defaultValue = "default")
    private String buildMode;
focal_class.type: String
focal_class.var_name: buildMode
focal_class.declarator: strip
focal_class.modifier: @Parameter(name = "strip", defaultValue = "false")
    private
focal_class.original_string: @Parameter(name = "strip", defaultValue = "false")
    private boolean strip;
focal_class.type: boolean
focal_class.var_name: strip
focal_class.declarator: ldFlags
focal_class.modifier: @Parameter(name = "ldFlags")
    private
focal_class.original_string: @Parameter(name = "ldFlags")
    private String[] ldFlags;
focal_class.type: String[]
focal_class.var_name: ldFlags
focal_class.file: mvn-golang-wrapper/src/main/java/com/igormaznitsa/mvngolang/GolangBuildMojo.java
focal_class.identifier: GolangBuildMojo
focal_class.class_method_signature: GolangBuildMojo.getLdflagsAsList()
focal_class.full_signature: @MustNotContainNull @Nonnull public List<String> getLdflagsAsList()
focal_class.identifier: getLdflagsAsList
focal_class.modifiers: @MustNotContainNull @Nonnull public
focal_class.parameters: ()
focal_class.return: List<String>
focal_class.signature: List<String> getLdflagsAsList()
focal_class.class_method_signature: GolangBuildMojo.getSkipMojoPropertySuffix()
focal_class.full_signature: @Nullable @Override protected String getSkipMojoPropertySuffix()
focal_class.identifier: getSkipMojoPropertySuffix
focal_class.modifiers: @Nullable @Override protected
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getSkipMojoPropertySuffix()
focal_class.class_method_signature: GolangBuildMojo.isStrip()
focal_class.full_signature: public boolean isStrip()
focal_class.identifier: isStrip
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isStrip()
focal_class.class_method_signature: GolangBuildMojo.setStrip(final boolean flag)
focal_class.full_signature: public void setStrip(final boolean flag)
focal_class.identifier: setStrip
focal_class.modifiers: public
focal_class.parameters: (final boolean flag)
focal_class.return: void
focal_class.signature: void setStrip(final boolean flag)
focal_class.class_method_signature: GolangBuildMojo.getBuildMode()
focal_class.full_signature: @Nonnull public String getBuildMode()
focal_class.identifier: getBuildMode
focal_class.modifiers: @Nonnull public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getBuildMode()
focal_class.class_method_signature: GolangBuildMojo.setBuilMode(@Nullable final String buildMode)
focal_class.full_signature: public void setBuilMode(@Nullable final String buildMode)
focal_class.identifier: setBuilMode
focal_class.modifiers: public
focal_class.parameters: (@Nullable final String buildMode)
focal_class.return: void
focal_class.signature: void setBuilMode(@Nullable final String buildMode)
focal_class.class_method_signature: GolangBuildMojo.getResultFile()
focal_class.full_signature: @Nonnull private File getResultFile()
focal_class.identifier: getResultFile
focal_class.modifiers: @Nonnull private
focal_class.parameters: ()
focal_class.return: File
focal_class.signature: File getResultFile()
focal_class.class_method_signature: GolangBuildMojo.getResultFolder()
focal_class.full_signature: @Nonnull public String getResultFolder()
focal_class.identifier: getResultFolder
focal_class.modifiers: @Nonnull public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getResultFolder()
focal_class.class_method_signature: GolangBuildMojo.setResultFolder(@Nonnull final String folder)
focal_class.full_signature: public void setResultFolder(@Nonnull final String folder)
focal_class.identifier: setResultFolder
focal_class.modifiers: public
focal_class.parameters: (@Nonnull final String folder)
focal_class.return: void
focal_class.signature: void setResultFolder(@Nonnull final String folder)
focal_class.class_method_signature: GolangBuildMojo.getResultName()
focal_class.full_signature: @Nonnull public String getResultName()
focal_class.identifier: getResultName
focal_class.modifiers: @Nonnull public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getResultName()
focal_class.class_method_signature: GolangBuildMojo.setResultName(@Nonnull final String resultName)
focal_class.full_signature: public void setResultName(@Nonnull final String resultName)
focal_class.identifier: setResultName
focal_class.modifiers: public
focal_class.parameters: (@Nonnull final String resultName)
focal_class.return: void
focal_class.signature: void setResultName(@Nonnull final String resultName)
focal_class.class_method_signature: GolangBuildMojo.getGoCommand()
focal_class.full_signature: @Override @Nonnull public String getGoCommand()
focal_class.identifier: getGoCommand
focal_class.modifiers: @Override @Nonnull public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getGoCommand()
focal_class.class_method_signature: GolangBuildMojo.beforeExecution(@Nullable final ProxySettings proxySettings)
focal_class.full_signature: @Override public void beforeExecution(@Nullable final ProxySettings proxySettings)
focal_class.identifier: beforeExecution
focal_class.modifiers: @Override public
focal_class.parameters: (@Nullable final ProxySettings proxySettings)
focal_class.return: void
focal_class.signature: void beforeExecution(@Nullable final ProxySettings proxySettings)
focal_class.class_method_signature: GolangBuildMojo.afterExecution(@Nullable final ProxySettings proxySettings, final boolean error)
focal_class.full_signature: @Override public void afterExecution(@Nullable final ProxySettings proxySettings, final boolean error)
focal_class.identifier: afterExecution
focal_class.modifiers: @Override public
focal_class.parameters: (@Nullable final ProxySettings proxySettings, final boolean error)
focal_class.return: void
focal_class.signature: void afterExecution(@Nullable final ProxySettings proxySettings, final boolean error)
focal_class.class_method_signature: GolangBuildMojo.isCommandSupportVerbose()
focal_class.full_signature: @Override public boolean isCommandSupportVerbose()
focal_class.identifier: isCommandSupportVerbose
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isCommandSupportVerbose()
focal_class.class_method_signature: GolangBuildMojo.getCommandFlags()
focal_class.full_signature: @Override @Nonnull @MustNotContainNull public String[] getCommandFlags()
focal_class.identifier: getCommandFlags
focal_class.modifiers: @Override @Nonnull @MustNotContainNull public
focal_class.parameters: ()
focal_class.return: String[]
focal_class.signature: String[] getCommandFlags()
focal_class.superclass: extends AbstractGoPackageAndDependencyAwareMojo
focal_method.body: @Override
    @Nonnull
    @MustNotContainNull
    public String[] getCommandFlags() {
      final List<String> flags = new ArrayList<>();
  
      flags.add("-buildmode=" + this.getBuildMode());
  
      final List<String> linkerflags = this.getLdflagsAsList();
  
      if (this.strip) {
        if (!linkerflags.contains("-s")) {
          linkerflags.add("-s");
        }
        if (!linkerflags.contains("-w")) {
          linkerflags.add("-w");
        }
      }
  
      if (!linkerflags.isEmpty()) {
        flags.add("-ldflags");
        final StringBuilder buffer = new StringBuilder();
        for (final String s : linkerflags) {
          if (buffer.length() > 0) {
            buffer.append(' ');
          }
          buffer.append(s);
        }
        flags.add(buffer.toString());
      }
  
      final String[] selectedPackages = this.getPackages();
      final String selectedResultName = this.getResultName();
  
      if (selectedPackages == null || selectedPackages.length < 2) {
        if ("none".equals(selectedResultName.trim())) {
          this.getLog().info("Result name is not defined so that '-o' option is not added.");
        } else {
          flags.add("-o");
          flags.add(this.getResultFile().getAbsolutePath());
        }
      }
  
      return flags.toArray(new String[0]);
    }
focal_method.class_method_signature: GolangBuildMojo.getCommandFlags()
focal_method.full_signature: @Override @Nonnull @MustNotContainNull public String[] getCommandFlags()
focal_method.identifier: getCommandFlags
focal_method.invocations: add getBuildMode getLdflagsAsList contains add contains add isEmpty add length append append add toString getPackages getResultName equals trim info getLog add add getAbsolutePath getResultFile toArray
focal_method.modifiers: @Override @Nonnull @MustNotContainNull public
focal_method.parameters: ()
focal_method.return: String[]
focal_method.signature: String[] getCommandFlags()