Skip to content

Commit

Permalink
Merge pull request #2311 from Shopify/deps/golangci-golangci-lint-act…
Browse files Browse the repository at this point in the history
…ion-3.x

chore(deps): bump golangci/golangci-lint-action action to v3
  • Loading branch information
dnwe authored Aug 10, 2022
2 parents a4e9613 + df5f91e commit a257e13
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
- name: golangci-lint
env:
GOFLAGS: -tags=functional
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v3
with:
version: v1.45.2
version: v1.48.0
test:
name: Unit Testing with Go ${{ matrix.go-version }}
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions async_producer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1498,6 +1498,7 @@ func TestAsyncProducerIdempotentEpochExhaustion(t *testing.T) {

// TestBrokerProducerShutdown ensures that a call to shutdown stops the
// brokerProducer run() loop and doesn't leak any goroutines
//
//nolint:paralleltest
func TestBrokerProducerShutdown(t *testing.T) {
defer leaktest.Check(t)()
Expand Down
16 changes: 9 additions & 7 deletions balance_strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ type BalanceStrategy interface {
// https://kafka.apache.org/31/javadoc/org/apache/kafka/clients/consumer/RangeAssignor.html
//
// Example with two topics T1 and T2 with six partitions each (0..5) and two members (M1, M2):
// M1: {T1: [0, 1, 2], T2: [0, 1, 2]}
// M2: {T2: [3, 4, 5], T2: [3, 4, 5]}
//
// M1: {T1: [0, 1, 2], T2: [0, 1, 2]}
// M2: {T2: [3, 4, 5], T2: [3, 4, 5]}
var BalanceStrategyRange = &balanceStrategy{
name: RangeBalanceStrategyName,
coreFn: func(plan BalanceStrategyPlan, memberIDs []string, topic string, partitions []int32) {
Expand All @@ -87,14 +88,15 @@ var BalanceStrategyRange = &balanceStrategy{
// BalanceStrategySticky assigns partitions to members with an attempt to preserve earlier assignments
// while maintain a balanced partition distribution.
// Example with topic T with six partitions (0..5) and two members (M1, M2):
// M1: {T: [0, 2, 4]}
// M2: {T: [1, 3, 5]}
//
// M1: {T: [0, 2, 4]}
// M2: {T: [1, 3, 5]}
//
// On reassignment with an additional consumer, you might get an assignment plan like:
// M1: {T: [0, 2]}
// M2: {T: [1, 3]}
// M3: {T: [4, 5]}
//
// M1: {T: [0, 2]}
// M2: {T: [1, 3]}
// M3: {T: [4, 5]}
var BalanceStrategySticky = &stickyBalanceStrategy{}

// --------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ func (b *Broker) AsyncProduce(request *ProduceRequest, cb ProduceCallback) error
return b.sendWithPromise(request, promise)
}

//Produce returns a produce response or error
// Produce returns a produce response or error
func (b *Broker) Produce(request *ProduceRequest) (*ProduceResponse, error) {
var (
response *ProduceResponse
Expand Down
1 change: 1 addition & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ func NewConfig() *Config {

// Validate checks a Config instance. It will return a
// ConfigurationError if the specified values don't make sense.
//
//nolint:gocyclo // This function's cyclomatic complexity has go beyond 100
func (c *Config) Validate() error {
// some configuration values should be warned on but not fail completely, do those first
Expand Down
4 changes: 1 addition & 3 deletions describe_groups_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,7 @@ func (gd *GroupDescription) decode(pd packetDecoder, version int16) (err error)
if err := block.decode(pd, gd.Version); err != nil {
return err
}
if block != nil {
gd.Members[block.MemberId] = block
}
gd.Members[block.MemberId] = block
}
}

Expand Down
1 change: 0 additions & 1 deletion offset_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ func (r *OffsetResponse) GetBlock(topic string, partition int32) *OffsetResponse
105 99 0 0 0 1 0 0
0 0 0 0 0 0 0 1
0 0 0 0 0 1 1 1] <nil>
*/
func (r *OffsetResponse) encode(pe packetEncoder) (err error) {
if r.Version >= 2 {
Expand Down
1 change: 0 additions & 1 deletion sarama.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ Consumer related metrics:
| consumer-group-sync-total-<GroupID> | counter | Total count of consumer group sync attempts |
| consumer-group-sync-failed-<GroupID> | counter | Total count of consumer group sync failures |
+-------------------------------------------+------------+--------------------------------------------------------------------------------------+
*/
package sarama

Expand Down
5 changes: 3 additions & 2 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,9 @@ func newKafkaVersion(major, minor, veryMinor, patch uint) KafkaVersion {

// IsAtLeast return true if and only if the version it is called on is
// greater than or equal to the version passed in:
// V1.IsAtLeast(V2) // false
// V2.IsAtLeast(V1) // true
//
// V1.IsAtLeast(V2) // false
// V2.IsAtLeast(V1) // true
func (v KafkaVersion) IsAtLeast(other KafkaVersion) bool {
for i := range v.version {
if v.version[i] > other.version[i] {
Expand Down

0 comments on commit a257e13

Please sign in to comment.