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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user