Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lint: enable govet shadow linter and resolve linter warnings #5261

Merged
merged 10 commits into from
Jun 1, 2023
Prev Previous commit
Next Next commit
fix shadow of struct token definition
  • Loading branch information
cce committed May 26, 2023
commit 25a357e8e920707485ce3d22e28fa5954e1a9190
6 changes: 3 additions & 3 deletions data/transactions/logic/assembler.go
Original file line number Diff line number Diff line change
Expand Up @@ -2019,15 +2019,15 @@ func (ops *OpStream) trackStack(args StackTypes, returns StackTypes, instruction
// nextStatement breaks tokens into two slices at the first semicolon and expands macros along the way.
func nextStatement(ops *OpStream, tokens []token) (current, rest []token) {
for i := 0; i < len(tokens); i++ {
token := tokens[i]
replacement, ok := ops.macros[token.str]
tok := tokens[i]
replacement, ok := ops.macros[tok.str]
if ok {
tokens = append(tokens[0:i], append(replacement[1:], tokens[i+1:]...)...)
// backup to handle potential re-expansion of the first token in the expansion
i--
continue
}
if token.str == ";" {
if tok.str == ";" {
return tokens[:i], tokens[i+1:]
}
}
Expand Down