Skip to content

Commit

Permalink
fix: lint issues from staticcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-gang committed Sep 5, 2024
1 parent dcdfa52 commit b44b775
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion internal/kafka_executable/kafka_executable.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func NewKafkaExecutable(stageHarness *test_case_harness.TestCaseHarness) *KafkaE

func (b *KafkaExecutable) Run(args ...string) error {
b.args = args
if b.args == nil || len(b.args) == 0 {
if len(b.args) == 0 {
b.logger.Infof("$ ./%s", path.Base(b.executable.Path))
} else {
var log string
Expand Down
1 change: 1 addition & 0 deletions protocol/api/api_versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func DecodeApiVersionsHeader(response []byte, version int16) (*ResponseHeader, e
return &responseHeader, nil
}

// DecodeApiVersionsHeaderAndResponse decodes the header and response
// If an error is encountered while decoding, the returned objects are nil
func DecodeApiVersionsHeaderAndResponse(response []byte, version int16) (*ResponseHeader, *ApiVersionsResponse, error) {
decoder := decoder.RealDecoder{}
Expand Down
8 changes: 4 additions & 4 deletions protocol/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ func (b *Broker) ConnectWithRetries(executable *kafka_executable.KafkaExecutable
}

// Don't print errors in the first second
if retries > 2 {
// ToDo: fixtures fail
// logger.Infof("Failed to connect to broker at %s, retrying in 1s", b.addr)
}
// ToDo: fixtures fail
// if retries > 2 {
// logger.Infof("Failed to connect to broker at %s, retrying in 1s", b.addr)
// }

retries += 1
time.Sleep(1000 * time.Millisecond)
Expand Down
1 change: 1 addition & 0 deletions protocol/encoder/real_encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ func (re *RealEncoder) PutCompactString(in string) {
func (re *RealEncoder) PutNullableCompactString(in *string) {
if in == nil {
re.PutInt8(0)
return
}
re.PutCompactString(*in)
}
Expand Down

0 comments on commit b44b775

Please sign in to comment.