Skip to content

Commit

Permalink
formatting and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillem committed Feb 16, 2024
1 parent 30a984a commit 77c2b9e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
5 changes: 4 additions & 1 deletion destination.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ func (d *Destination) Open(ctx context.Context) (err error) {
if err != nil {
return fmt.Errorf("failed to bind queue to exchange: %w", err)
}
sdk.Logger(ctx).Debug().Msgf("bound queue %s to exchange %s with routing key %s", d.config.QueueName, d.config.Exchange.Name, d.config.RoutingKey)
sdk.Logger(ctx).Debug().Msgf(
"bound queue %s to exchange %s with routing key %s",
d.config.QueueName, d.config.Exchange.Name, d.config.RoutingKey,
)
}

return nil
Expand Down
5 changes: 4 additions & 1 deletion source.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ func (s *Source) Open(ctx context.Context, sdkPos sdk.Position) (err error) {
}

if s.config.QueueName != "" && s.config.QueueName != pos.QueueName {
return fmt.Errorf("the old position contains a different queue name than the connector configuration (%q vs %q), please check if the configured queue name changed since the last run", pos.QueueName, s.config.QueueName)
return fmt.Errorf(
"the old position contains a different queue name than the connector configuration (%q vs %q), please check if the configured queue name changed since the last run",
pos.QueueName, s.config.QueueName,
)
}

sdk.Logger(ctx).Debug().Msg("got queue name from given position")
Expand Down
7 changes: 0 additions & 7 deletions utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ import (
"github.com/rabbitmq/amqp091-go"
)

func init() {
// Uncomment this to set up a logger for tests to use. By default
// sdk.Logger log calls won't output anything
// log := log.Output(zerolog.ConsoleWriter{Out: os.Stderr})
// zerolog.DefaultContextLogger = &log
}

// cfgToMap converts a config struct to a map. This is useful for more type
// safety on tests.
func cfgToMap(cfg any) map[string]string {
Expand Down

0 comments on commit 77c2b9e

Please sign in to comment.