Activate lint for unused code.

This commit is contained in:
Jeffrey Regan
2019-11-18 06:25:50 -08:00
parent 5381daf95a
commit 83db25d6c4
8 changed files with 20 additions and 20 deletions

View File

@@ -70,7 +70,9 @@ func (rv *refVarTransformer) replaceVars(in interface{}) (interface{}, error) {
// This field can potentially contain a $(VAR) since it is
// of string type.
return expansion2.Expand(s, rv.mappingFunc), nil
//nolint:staticcheck (erroneously claims that `case nil` is unreachable)
// staticcheck erroneously claims that `case nil`
// is unreachable here, so suppressing it.
//nolint:staticcheck
case nil:
return nil, nil
default:

View File

@@ -157,7 +157,7 @@ func TestUpdateResourceOptions(t *testing.T) {
if !a.Equals(b) {
t.Errorf("expected %v got %v", a, b)
}
if a.NeedHashSuffix() != b.NeedHashSuffix() {
if a.ShouldAddHashSuffixToName() != b.ShouldAddHashSuffixToName() {
t.Errorf("")
}
if a.Behavior() != b.Behavior() {

View File

@@ -222,11 +222,6 @@ func (kt *KustTarget) computeInventory(
return ra.Transform(p)
}
func (kt *KustTarget) shouldAddHashSuffixesToGeneratedResources() bool {
return kt.kustomization.GeneratorOptions == nil ||
!kt.kustomization.GeneratorOptions.DisableNameSuffixHash
}
// AccumulateTarget returns a new ResAccumulator,
// holding customized resources and the data/rules used
// to do so. The name back references and vars are