Skip to content

A few small staticcheck fixes #2361

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

Merged
merged 1 commit into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions internal/cmd/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,11 @@ func readConfig(stderr io.Writer, dir, filename string) (string, *config.Config,
if err != nil {
switch err {
case config.ErrMissingVersion:
fmt.Fprintf(stderr, errMessageNoVersion)
fmt.Fprint(stderr, errMessageNoVersion)
case config.ErrUnknownVersion:
fmt.Fprintf(stderr, errMessageUnknownVersion)
fmt.Fprint(stderr, errMessageUnknownVersion)
case config.ErrNoPackages:
fmt.Fprintf(stderr, errMessageNoPackages)
fmt.Fprint(stderr, errMessageNoPackages)
}
fmt.Fprintf(stderr, "error parsing %s: %s\n", base, err)
return "", nil, err
Expand Down
2 changes: 1 addition & 1 deletion internal/sql/catalog/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type Schema struct {

func (s *Schema) getFunc(rel *ast.FuncName, tns []*ast.TypeName) (*Function, int, error) {
for i := range s.Funcs {
if strings.ToLower(s.Funcs[i].Name) != strings.ToLower(rel.Name) {
if !strings.EqualFold(s.Funcs[i].Name, rel.Name) {
continue
}

Expand Down
2 changes: 1 addition & 1 deletion internal/sql/validate/param_ref.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func ParamRef(n ast.Node) (map[int]bool, bool, error) {
}
}), n)
if dollar && nodollar {
return nil, false, errors.New("Can not mix $1 format with ? format")
return nil, false, errors.New("can not mix $1 format with ? format")
}

seen := map[int]bool{}
Expand Down