Skip to content

Commit

Permalink
Drop scary warning (ko-build#439)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonjohnsonjr authored Sep 16, 2021
1 parent eef795f commit 61d5250
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions pkg/build/gobuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,6 @@ import (

const (
defaultAppFilename = "ko-app"

gorootWarningTemplate = `NOTICE!
-----------------------------------------------------------------
ko and go have mismatched GOROOT:
go/build.Default.GOROOT = %q
$(go env GOROOT) = %q
Inferring GOROOT=%q
Run this to remove this warning:
export GOROOT=$(go env GOROOT)
For more information see:
https://github.com/google/ko/issues/106
-----------------------------------------------------------------
`
)

// GetBase takes an importpath and returns a base image reference and base image (or index).
Expand Down Expand Up @@ -233,11 +217,10 @@ func NewGo(ctx context.Context, dir string, options ...Option) (Interface, error
}

// If $(go env GOROOT) successfully returns a non-empty string that differs from
// the default build context GOROOT, print a warning and use $(go env GOROOT).
// the default build context GOROOT, use $(go env GOROOT) instead.
bc := gb.Default
bc.Dir = dir
if goroot != "" && bc.GOROOT != goroot {
log.Printf(gorootWarningTemplate, bc.GOROOT, goroot, goroot)
bc.GOROOT = goroot
}

Expand Down

0 comments on commit 61d5250

Please sign in to comment.