- kiosk.ReadIdentity: ID()/Requires() as literals or constants across packages and modules, read with go/parser, never run - plugin minimums from go.mod requires; v0.0.0 is an error, a pseudo-version warns - kiosk.Validate, kiosk.CheckT (no testing import) - plugin:add reads IDs through kiosk.ReadIdentity, so const-ID plugins register
25 lines
730 B
Go
25 lines
730 B
Go
// Package consts is a test fixture: ID() and Requires() return constants
|
|
// of the same package, of another package in the module and of a package
|
|
// in another module. kiosk reads it with go/parser; it is never built.
|
|
package consts
|
|
|
|
import (
|
|
"example.test/sm-consts-plugin/ids"
|
|
"example.test/sm-other-plugin"
|
|
)
|
|
|
|
// PluginID is the plugin ID, built from two constants.
|
|
const PluginID = vendor + ".consts"
|
|
|
|
// Plugin is the fixture plugin.
|
|
type Plugin struct{}
|
|
|
|
// ID returns PluginID.
|
|
func (*Plugin) ID() string { return PluginID }
|
|
|
|
// Requires a plugin whose module is not required (acme.translate) and the
|
|
// plugin of the other module.
|
|
func (*Plugin) Requires() []string {
|
|
return []string{ids.Translate, other.PluginID}
|
|
}
|