Merge pull request #255 from colincross/mutator_name
Add MutatorName to mutator contexts
diff --git a/module_ctx.go b/module_ctx.go
index f72451b..37079ad 100644
--- a/module_ctx.go
+++ b/module_ctx.go
@@ -675,6 +675,9 @@
// Rename all variants of a module. The new name is not visible to calls to ModuleName,
// AddDependency or OtherModuleName until after this mutator pass is complete.
Rename(name string)
+
+ // MutatorName returns the name that this mutator was registered with.
+ MutatorName() string
}
type EarlyMutatorContext interface {
@@ -808,6 +811,10 @@
var _ DependencyTag = BaseDependencyTag{}
+func (mctx *mutatorContext) MutatorName() string {
+ return mctx.name
+}
+
func (mctx *mutatorContext) CreateVariations(variationNames ...string) []Module {
return mctx.createVariations(variationNames, false)
}