mirror of
https://github.com/opentofu/opentofu.git
synced 2026-05-28 04:15:54 -04:00
Address linting issues in addrs package (#2777)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
This commit is contained in:
parent
ae542df787
commit
5fdf66c943
3 changed files with 6 additions and 6 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue