preserve order when removing module from state
This commit is contained in:
parent
ccc9b1d767
commit
14cc654b16
|
@ -60,9 +60,7 @@ func (n *EvalDeleteModule) Eval(ctx EvalContext) (interface{}, error) {
|
||||||
log.Printf("[DEBUG] cannot remove module %s, not empty", modulePrefixStr(n.PathValue))
|
log.Printf("[DEBUG] cannot remove module %s, not empty", modulePrefixStr(n.PathValue))
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
tail := len(state.Modules) - 1
|
state.Modules = append(state.Modules[:i], state.Modules[i+1:]...)
|
||||||
state.Modules[i] = state.Modules[tail]
|
|
||||||
state.Modules = state.Modules[:tail]
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue