Skip to content

Commit

Permalink
checkers: add default branch in switch (go-critic#807)
Browse files Browse the repository at this point in the history
  • Loading branch information
cristaloleg authored Feb 20, 2019
1 parent fe98086 commit 87178fd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions checkers/internal/lintutil/zero_value.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@ func ZeroValueOf(typeExpr ast.Expr, typ types.Type) ast.Expr {

case *types.Array, *types.Struct:
return &ast.CompositeLit{Type: typeExpr}
}

return nil
default:
return nil
}
}

func isDefaultLiteralType(typ types.Type) bool {
Expand Down

0 comments on commit 87178fd

Please sign in to comment.