mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
Report unused variables.
This commit is contained in:
@@ -36,11 +36,14 @@ func syntaxWrap(input string) string {
|
||||
// implements the expansion semantics defined in the expansion spec; it
|
||||
// returns the input string wrapped in the expansion syntax if no mapping
|
||||
// for the input is found.
|
||||
func MappingFuncFor(context ...map[string]string) func(string) string {
|
||||
func MappingFuncFor(
|
||||
counts map[string]int,
|
||||
context ...map[string]string) func(string) string {
|
||||
return func(input string) string {
|
||||
for _, vars := range context {
|
||||
val, ok := vars[input]
|
||||
if ok {
|
||||
counts[input]++
|
||||
return val
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user