Skip to content

Commit

Permalink
delete unneceserry flags, add single file build
Browse files Browse the repository at this point in the history
  • Loading branch information
hunyadvari-peter committed Nov 30, 2016
1 parent dc50315 commit 49cecec
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions go.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,19 @@ func GoCrossCompile(opts *CompileOpts) error {
if opts.Rebuild {
args = append(args, "-a")
}
if opts.Gcflags != "" {
args = append(args,
"-gcflags", opts.Gcflags)
}
if opts.Ldflags != "" {
args = append(args,
"-ldflags", opts.Ldflags)
}
if opts.Tags != "" {
args = append(args,
"-tags", opts.Tags)
}
args = append(args,
"-gcflags", opts.Gcflags,
"-ldflags", opts.Ldflags,
"-tags", opts.Tags,
"-o", outputPathReal,
opts.PackagePath)

Expand All @@ -137,7 +146,7 @@ func GoMainDirs(packages []string, GoCmd string) ([]string, error) {
}

results := make([]string, 0, len(output))
for _, line := range strings.Split(output, "\n") {
for indx, line := range strings.Split(output, "\n") {
if line == "" {
continue
}
Expand All @@ -149,8 +158,13 @@ func GoMainDirs(packages []string, GoCmd string) ([]string, error) {
}

if parts[0] == "main" {
results = append(results, parts[1])
if parts[1] == "command-line-arguments" {
results = append(results, packages[indx])
} else {
results = append(results, parts[1])
}
}

}

return results, nil
Expand Down

0 comments on commit 49cecec

Please sign in to comment.