Skip to content

Commit

Permalink
ci: fix linter warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Felix Gateru <[email protected]>
  • Loading branch information
felixgateru committed Jan 30, 2025
1 parent 0d127da commit f1aeccf
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 22 deletions.
1 change: 0 additions & 1 deletion cmd/coap/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ type config struct {
InstanceID string `env:"SMQ_COAP_ADAPTER_INSTANCE_ID" envDefault:""`
TraceRatio float64 `env:"SMQ_JAEGER_TRACE_RATIO" envDefault:"1.0"`
ESURL string `env:"SMQ_ES_URL" envDefault:"nats://localhost:4222"`
ESURL string `env:"SMQ_ES_URL" envDefault:"nats://localhost:4222"`
}

func main() {
Expand Down
1 change: 0 additions & 1 deletion cmd/http/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ type config struct {
InstanceID string `env:"SMQ_HTTP_ADAPTER_INSTANCE_ID" envDefault:""`
TraceRatio float64 `env:"SMQ_JAEGER_TRACE_RATIO" envDefault:"1.0"`
ESURL string `env:"SMQ_ES_URL" envDefault:"nats://localhost:4222"`
ESURL string `env:"SMQ_ES_URL" envDefault:"nats://localhost:4222"`
}

func main() {
Expand Down
1 change: 0 additions & 1 deletion mqtt/events/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ type subscribeEvent struct {
subtopic string
}

func (se subscribeEvent) Encode() (map[string]interface{}, error) {
func (se subscribeEvent) Encode() (map[string]interface{}, error) {
return map[string]interface{}{
"operation": se.operation,
Expand Down
18 changes: 0 additions & 18 deletions mqtt/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ var (
ErrFailedParseSubtopic = errors.New("failed to parse subtopic")
ErrFailedPublishConnectEvent = errors.New("failed to publish connect event")
ErrFailedSubscribeEvent = errors.New("failed to publish subscribe event")
ErrFailedSubscribeEvent = errors.New("failed to publish subscribe event")
ErrFailedPublishToMsgBroker = errors.New("failed to publish to supermq message broker")
)

Expand Down Expand Up @@ -290,23 +289,6 @@ func parseTopic(topic string) (string, string, error) {
return chanID, subtopic, nil
}

func parseTopic(topic string) (string, string, error) {
channelParts := channelRegExp.FindStringSubmatch(topic)
if len(channelParts) < 2 {
return "", "", errors.Wrap(ErrFailedPublish, ErrMalformedTopic)
}

chanID := channelParts[1]
subtopic := channelParts[2]

subtopic, err := parseSubtopic(subtopic)
if err != nil {
return "", "", errors.Wrap(ErrFailedParseSubtopic, err)
}

return chanID, subtopic, nil
}

func parseSubtopic(subtopic string) (string, error) {
if subtopic == "" {
return subtopic, nil
Expand Down
1 change: 0 additions & 1 deletion mqtt/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,6 @@ func TestSubscribe(t *testing.T) {
assert.Contains(t, logBuffer.String(), tc.logMsg)
assert.Equal(t, tc.err, err)
eventsCall.Unset()
eventsCall.Unset()
}
}

Expand Down

0 comments on commit f1aeccf

Please sign in to comment.