Skip to content

Commit

Permalink
chore: bump golangci-lint to v1.57.0 (#365)
Browse files Browse the repository at this point in the history
  • Loading branch information
nrwiersma authored Mar 20, 2024
1 parent 1cb8acd commit fd90800
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
go-version: [ "1.21", "1.22" ]
runs-on: ubuntu-latest
env:
GOLANGCI_LINT_VERSION: v1.55.2
GOLANGCI_LINT_VERSION: v1.57.0

steps:
- name: Install Go
Expand All @@ -38,7 +38,6 @@ jobs:
with:
version: ${{ env.GOLANGCI_LINT_VERSION }}
skip-pkg-cache: true
args: --go ${{ matrix.go-version }}

- name: Run tests
run: go test -covermode=count -coverprofile=coverage.out ./...
Expand Down
5 changes: 3 additions & 2 deletions cmd/avrogen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"bytes"
"errors"
"flag"
"fmt"
"go/format"
Expand Down Expand Up @@ -111,11 +112,11 @@ func realMain(args []string, stdout, stderr io.Writer) int {

func validateOpts(nargs int, cfg config) error {
if nargs < 1 {
return fmt.Errorf("at least one schema is required")
return errors.New("at least one schema is required")
}

if cfg.Pkg == "" {
return fmt.Errorf("a package is required")
return errors.New("a package is required")
}

return nil
Expand Down
5 changes: 3 additions & 2 deletions registry/decoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package registry
import (
"context"
"encoding/binary"
"errors"
"fmt"

"github.com/hamba/avro/v2"
Expand Down Expand Up @@ -43,7 +44,7 @@ func NewDecoder(client *Client, opts ...DecoderFunc) *Decoder {
// https://docs.confluent.io/3.2.0/schema-registry/docs/serializer-formatter.html#wire-format.
func (d *Decoder) Decode(ctx context.Context, data []byte, v any) error {
if len(data) < 6 {
return fmt.Errorf("data too short")
return errors.New("data too short")
}

id, err := extractSchemaID(data)
Expand All @@ -61,7 +62,7 @@ func (d *Decoder) Decode(ctx context.Context, data []byte, v any) error {

func extractSchemaID(data []byte) (int, error) {
if len(data) < 5 {
return 0, fmt.Errorf("data too short")
return 0, errors.New("data too short")
}
if data[0] != 0 {
return 0, fmt.Errorf("invalid magic byte: %x", data[0])
Expand Down

0 comments on commit fd90800

Please sign in to comment.