mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-25 01:00:16 -05:00
Address linting issues in addrs package (#2777)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
This commit is contained in:
@@ -206,14 +206,14 @@ func TestIsForModule(t *testing.T) {
|
||||
func BenchmarkStringShort(b *testing.B) {
|
||||
addr, _ := ParseModuleInstanceStr(`module.foo`)
|
||||
for n := 0; n < b.N; n++ {
|
||||
addr.String()
|
||||
_ = addr.String()
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkStringLong(b *testing.B) {
|
||||
addr, _ := ParseModuleInstanceStr(`module.southamerica-brazil-region.module.user-regional-desktops.module.user-name`)
|
||||
for n := 0; n < b.N; n++ {
|
||||
addr.String()
|
||||
_ = addr.String()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -93,14 +93,14 @@ func TestModuleString(t *testing.T) {
|
||||
func BenchmarkModuleStringShort(b *testing.B) {
|
||||
module := Module{"a", "b"}
|
||||
for n := 0; n < b.N; n++ {
|
||||
module.String()
|
||||
_ = module.String()
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkModuleStringLong(b *testing.B) {
|
||||
module := Module{"southamerica-brazil-region", "user-regional-desktop", "user-name"}
|
||||
for n := 0; n < b.N; n++ {
|
||||
module.String()
|
||||
_ = module.String()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -51,8 +51,8 @@ func ParseTarget(traversal hcl.Traversal) (*Target, tfdiags.Diagnostics) {
|
||||
}
|
||||
|
||||
var subject Targetable
|
||||
switch {
|
||||
case riAddr.Resource.Key == NoKey:
|
||||
switch riAddr.Resource.Key {
|
||||
case NoKey:
|
||||
// We always assume that a no-key instance is meant to
|
||||
// be referring to the whole resource, because the distinction
|
||||
// doesn't really matter for targets anyway.
|
||||
|
||||
Reference in New Issue
Block a user