Skip to content

Commit

Permalink
Remove unnecessary 'go get' commands
Browse files Browse the repository at this point in the history
Signed-off-by: Matej Vašek <[email protected]>
  • Loading branch information
matejvasek committed Sep 27, 2024
1 parent ad0b694 commit 74e90d9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 22 deletions.
1 change: 0 additions & 1 deletion pkg/builders/s2i/assemblers.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ if [[ $(go list -f {{.Incomplete}}) == "true" ]]; then
exec /$STI_SCRIPTS_PATH/usage
else
pushd .s2i/builds/last
go get f
go build -o /opt/app-root/gobinary
popd
popd
Expand Down
11 changes: 1 addition & 10 deletions pkg/functions/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,21 +110,12 @@ func runGo(ctx context.Context, job *Job) (err error) {
fmt.Printf("cd %v && go build -o f.bin\n", job.Dir())
}

// Get the dependencies of the function
cmd := exec.CommandContext(ctx, "go", "get", "f")
cmd.Dir = job.Dir()
cmd.Stderr = os.Stderr
cmd.Stdout = os.Stdout
if err = cmd.Run(); err != nil {
return
}

// Build
args := []string{"build", "-o", "f.bin"}
if job.verbose {
args = append(args, "-v")
}
cmd = exec.CommandContext(ctx, "go", args...)
cmd := exec.CommandContext(ctx, "go", args...)
cmd.Dir = job.Dir()
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
Expand Down
12 changes: 1 addition & 11 deletions pkg/oci/containerize_go.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,8 @@ func goBuild(cfg *buildConfig, p v1.Platform) (binPath string, err error) {
fmt.Printf(" %v\n", filepath.Base(outpath))
}

// Get the dependencies of the function
cmd := exec.CommandContext(cfg.ctx, gobin, "get", "f")
cmd.Env = envs
cmd.Dir = cfg.buildDir()
cmd.Stderr = os.Stderr
cmd.Stdout = os.Stdout
if err = cmd.Run(); err != nil {
return
}

// Build the function
cmd = exec.CommandContext(cfg.ctx, gobin, args...)
cmd := exec.CommandContext(cfg.ctx, gobin, args...)
cmd.Env = envs
cmd.Dir = cfg.buildDir()
cmd.Stderr = os.Stderr
Expand Down

0 comments on commit 74e90d9

Please sign in to comment.