Skip to content

Commit

Permalink
Fixed lint errors. Made CI run on PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanrolds committed Aug 27, 2023
1 parent 986f197 commit 473fb6c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: build
on:
push:
on: [push, pull_request]
jobs:
golangci:
name: lint
Expand Down
19 changes: 10 additions & 9 deletions pkg/analyzer/analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package analyzer

import (
"go/types"

"golang.org/x/tools/go/analysis"
"golang.org/x/tools/go/analysis/passes/buildssa"
"golang.org/x/tools/go/ssa"
Expand Down Expand Up @@ -171,11 +172,11 @@ func getTargetTypesValues(b *ssa.BasicBlock, i int, targetTypes []any) []targetV
for _, targetType := range targetTypes {
var tt types.Type

switch targetType.(type) {
switch t := targetType.(type) {
case *types.Pointer:
tt = targetType.(*types.Pointer)
tt = t
case *types.Named:
tt = targetType.(*types.Named)
tt = t
default:
continue
}
Expand Down Expand Up @@ -297,11 +298,11 @@ func getAction(instr ssa.Instruction, targetTypes []any) action {
for _, targetType := range targetTypes {
var tt types.Type

switch targetType.(type) {
switch t := targetType.(type) {
case *types.Pointer:
tt = targetType.(*types.Pointer)
tt = t
case *types.Named:
tt = targetType.(*types.Named)
tt = t
default:
continue
}
Expand Down Expand Up @@ -361,11 +362,11 @@ func checkDeferred(pass *analysis.Pass, instrs *[]ssa.Instruction, targetTypes [
for _, targetType := range targetTypes {
var tt types.Type

switch targetType.(type) {
switch t := targetType.(type) {
case *types.Pointer:
tt = targetType.(*types.Pointer)
tt = t
case *types.Named:
tt = targetType.(*types.Named)
tt = t
default:
continue
}
Expand Down

0 comments on commit 473fb6c

Please sign in to comment.