mage
mage copied to clipboard
Bug: using Default with imports selects first matching func by name
Bug Description
When using imports, namespaces and Default, the getFunction() function will return the first matching function in the import with the same name, regardless of namespacing.
So
// project magefile.go
var Default = mage.Test
// imported repo
type Docker mg.Namespace
func (Docker) Test() {
log.Println("docker")
}
func Test() {
log.Println("test")
}
Will find Docker.Test() before Test().
What did you do?
Created a test repository as an example
What did you expect to happen?
$ mage
test
What actually happened?
$ mage
docker
Environment
- Mage Version: Mage Build Tool 1.15.0
- OS: darwin/arm64
Additional context
ooh, thanks for the report and the repro steps
I did a PR as well to fix it #509