Skip to content

Commit

Permalink
fix: remove idea folxer
Browse files Browse the repository at this point in the history
  • Loading branch information
bradub committed Dec 25, 2023
1 parent cfd1179 commit 02bc902
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 25 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/codeql_pagination.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
name: "codeql kafkadocker"
name: "codeql pagination"

on:
push:
branches: [ main ]
paths: [ kafkadocker/** ]
paths: [ pagination/** ]

pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
paths: [ kafkadocker/** ]
paths: [ pagination/** ]

schedule:
- cron: '0 17 * * 5'
Expand All @@ -31,7 +31,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/grype_pagination.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: grype grpc
name: grype pagination

on:
push:
branches: [ main ]
paths: [ grpc/** ]
paths: [ pagination/** ]

jobs:
scan-source:
Expand All @@ -16,11 +16,11 @@ jobs:
contents: read

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: anchore/scan-action@v3
id: scan
with:
path: grpc
path: pagination
fail-build: true
acs-report-enable: true
severity-cutoff: medium
Expand Down
16 changes: 7 additions & 9 deletions .github/workflows/lint-test_pagination.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
name: lint-test-kafkadocker
name: lint-test-pagination

on:
# Trigger the workflow on push request if the files
# in ./pubsub package were modified
push:
branches:
- main
paths:
- kafkadocker/**
- pagination/**

env:
PACKAGE: kafkadocker
PACKAGE: pagination

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: stable

Expand All @@ -37,10 +35,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: stable

Expand Down
3 changes: 2 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ run:
linters-settings:
staticcheck:
# Select the Go version to target. The default is '1.13'.
go: "1.20"
go: "1.21"
# https://staticcheck.io/docs/options#checks
checks: [ "all" ]

Expand Down Expand Up @@ -88,6 +88,7 @@ linters-settings:
- eg *errgroup.Group
- r *http.Request
- w http.ResponseWriter
- v reflect.Value

revive:
ignore-generated-header: true
Expand Down
5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion psqldocker/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Adrian Brad
Copyright (c) 2022 Purpose in Play

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
16 changes: 10 additions & 6 deletions pubsub/kafkasarama/kafkasarama_subscriber.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ var _ pubsub.Subscriber[[]byte] = (*Subscriber)(nil)

// Subscriber represents a kafka subscriber.
type Subscriber struct {
logger *slog.Logger
cfg *sarama.Config
brokers []string
logger *slog.Logger
cfg *sarama.Config
brokers []string
consumerGroup string
}

// NewSubscriber creates a new kafka subscriber.
Expand All @@ -37,9 +38,10 @@ func NewSubscriber(
}

return &Subscriber{
logger: slog.New(slogHandler),
cfg: cfg,
brokers: brokers,
logger: slog.New(slogHandler),
cfg: cfg,
brokers: brokers,
consumerGroup: consumerGroup,
}, nil
}

Expand All @@ -49,6 +51,8 @@ func (s Subscriber) Subscribe(channels ...string) (pubsub.Subscription[[]byte],
return nil, pubsub.ErrExactlyOneChannelAllowed
}

sarama.NewConsumerGroup(s.brokers, s.consumerGroup, s.cfg)

Check failure on line 54 in pubsub/kafkasarama/kafkasarama_subscriber.go

View workflow job for this annotation

GitHub Actions / Lint

Error return value of `sarama.NewConsumerGroup` is not checked (errcheck)

consumer, err := sarama.NewConsumer(s.brokers, s.cfg)
if err != nil {
return nil, fmt.Errorf("new sarama consumer: %w", err)
Expand Down

0 comments on commit 02bc902

Please sign in to comment.