diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 54dd7cb..27d1e79 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: - go-version: ^1.20 + go-version: ^1.21 - name: golangci-lint uses: golangci/golangci-lint-action@v2 diff --git a/.github/workflows/publish_executables.yaml b/.github/workflows/publish_executables.yaml index 3e52f43..c06ad1a 100644 --- a/.github/workflows/publish_executables.yaml +++ b/.github/workflows/publish_executables.yaml @@ -14,7 +14,7 @@ jobs: - uses: actions/setup-go@v2 with: - go-version: ^1.20 + go-version: ^1.21 - name: Cache go modules uses: actions/cache@v2 diff --git a/cmd/sub/root.go b/cmd/sub/root.go index ffafc0e..3a5b0a9 100644 --- a/cmd/sub/root.go +++ b/cmd/sub/root.go @@ -54,7 +54,11 @@ var rootCmd = &cobra.Command{ // start service ctx := context.Background() toMqtt := helper.ToMqtt{} - toMqtt.Start(ctx, cfg) + err = toMqtt.Start(ctx, cfg) + if err != nil { + logger.Fatal("error on starting the service", zap.Error(err)) + } + }, } diff --git a/pkg/service/adapter/service.go b/pkg/service/adapter/service.go index 6d79e64..b837bac 100644 --- a/pkg/service/adapter/service.go +++ b/pkg/service/adapter/service.go @@ -141,9 +141,10 @@ func (s *Service) mqttMessageProcessor(item interface{}) { if err != nil { s.logger.Error("error on writing a message to mqtt", zap.String("adapterName", s.adapterConfig.Name), zap.String("provider", s.adapterConfig.Provider), zap.Error(err)) } - } else { - // TODO: this message will be dropped, needs to handle this message } + // else { + // TODO: this message will be dropped, needs to handle this message + // } } func (s *Service) sourceMessageProcessor(item interface{}) { @@ -165,9 +166,10 @@ func (s *Service) sourceMessageProcessor(item interface{}) { if err != nil { s.logger.Error("error on writing a message to source device", zap.String("adapterName", s.adapterConfig.Name), zap.String("provider", s.adapterConfig.Provider), zap.Error(err)) } - } else { - // TODO: this message will be dropped, needs to handle this message } + // else { + // TODO: this message will be dropped, needs to handle this message + // } } func (s *Service) onMqttMessage(message *types.Message) {