1
0
mirror of https://github.com/ko-build/ko.git synced 2025-11-06 09:19:12 +02:00

Remove deprecated things. (#162)

Fixes: https://github.com/google/ko/issues/158
Fixes: https://github.com/google/ko/issues/160
This commit is contained in:
Matt Moore
2020-09-24 16:14:58 -07:00
committed by GitHub
parent 8b52ec2374
commit 33e66aca49
4 changed files with 39 additions and 73 deletions

View File

@@ -168,40 +168,20 @@ func NewGo(options ...Option) (Interface, error) {
return gbo.Open()
}
const Deprecation158 = `NOTICE!
-----------------------------------------------------------------
We will start requiring ko:// in a coming release. Please prefix
the following import path for things to continue working:
%s
For more information see:
https://github.com/google/ko/issues/158
-----------------------------------------------------------------
`
// IsSupportedReference implements build.Interface
//
// Only valid importpaths that provide commands (i.e., are "package main") are
// supported.
func (g *gobuild) IsSupportedReference(s string) bool {
ref := newRef(s)
if p, err := g.importPackage(ref); err != nil {
if ref.IsStrict() {
log.Fatalf("%q is not supported: %v", ref.String(), err)
}
if !ref.IsStrict() {
return false
} else if p.IsCommand() {
if !ref.IsStrict() {
log.Printf(Deprecation158, s)
}
return true
} else if ref.IsStrict() {
log.Fatalf(`%q does not have "package main"`, ref.String())
}
return false
p, err := g.importPackage(ref)
if err != nil {
return false
}
return p.IsCommand()
}
// importPackage wraps go/build.Import to handle go modules.