Skip to content

Commit

Permalink
fix break from switch in loop
Browse files Browse the repository at this point in the history
  • Loading branch information
jbardin committed Dec 2, 2020
1 parent 44ccb94 commit ddb5b9e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions addrs/module_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func parseModuleInstancePrefix(traversal hcl.Traversal) (ModuleInstance, hcl.Tra
var mi ModuleInstance
var diags tfdiags.Diagnostics

LOOP:
for len(remain) > 0 {
var next string
switch tt := remain[0].(type) {
Expand All @@ -96,7 +97,7 @@ func parseModuleInstancePrefix(traversal hcl.Traversal) (ModuleInstance, hcl.Tra
Detail: "Module address prefix must be followed by dot and then a name.",
Subject: remain[0].SourceRange().Ptr(),
})
break
break LOOP
}

if next != "module" {
Expand Down Expand Up @@ -129,7 +130,7 @@ func parseModuleInstancePrefix(traversal hcl.Traversal) (ModuleInstance, hcl.Tra
Detail: "Prefix \"module.\" must be followed by a module name.",
Subject: remain[0].SourceRange().Ptr(),
})
break
break LOOP
}
remain = remain[1:]
step := ModuleInstanceStep{
Expand Down

0 comments on commit ddb5b9e

Please sign in to comment.