Skip to content

Commit

Permalink
Fix ci pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
jjti committed Dec 27, 2023
1 parent 2573a0a commit 3ffbd2e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- run: cd /tmp && go install github.com/jjti/go-spanlint@${{ env.version }} && spanlint -h
- run: cd /tmp && go install github.com/jjti/go-spanlint/cmd/spanlint@${{ env.version }} && spanlint -h
env:
version: ${{ env.GITHUB_EVENT_PULL_REQUEST_HEAD_SHA || env.GITHUB_REF_SLUG }}

Expand Down
3 changes: 1 addition & 2 deletions spanlint.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,7 @@ func missingSpanCalls(
switch n.(type) {
case *ast.FuncLit:
if len(stack) > 0 {
// return false // don't stray into nested functions
return true // don't stray into nested functions
return false // don't stray into nested functions
}
case nil:
stack = stack[:len(stack)-1] // pop
Expand Down
11 changes: 11 additions & 0 deletions testdata/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,17 @@ func _() error {
return nil
}

func _() error {
_, span := otel.Tracer("foo").Start(context.Background(), "bar")
defer span.End()

if true {
return nil
}

return nil
}

func _() error {
_, span := otel.Tracer("foo").Start(context.Background(), "bar")
defer span.End()
Expand Down

0 comments on commit 3ffbd2e

Please sign in to comment.