Skip to content

Commit 50d26fe

Browse files
committed
chore: add short var declaration
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
1 parent 0def311 commit 50d26fe

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

scripts/rules.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,14 @@ func publishInTransaction(m dsl.Matcher) {
148148
$_ = $ps.Publish($evt, $msg)
149149
$*_
150150
}, $*_)
151+
`,
152+
// Alternative with short variable declaration
153+
`
154+
$x.InTx(func($y) error {
155+
$*_
156+
$_ := $ps.Publish($evt, $msg)
157+
$*_
158+
}, $*_)
151159
`,
152160
// Without catching error return
153161
`

0 commit comments

Comments
 (0)