build: fix various lint issues

revive default configuration has changed in 1.3.0. Some stuff is a bit
silly (like empty blocks), but I find it easier to follow that than to
try to tweak the configuration.
This commit is contained in:
Vincent Bernat
2023-03-21 00:01:13 +01:00
parent 1408634bad
commit 1ec89aac1f
17 changed files with 41 additions and 53 deletions

View File

@@ -22,19 +22,19 @@ func (l *logger) LogMode(gormlogger.LogLevel) gormlogger.Interface {
return l
}
func (l *logger) Info(ctx context.Context, s string, args ...interface{}) {
func (l *logger) Info(_ context.Context, s string, args ...interface{}) {
l.r.Info().Msgf(s, args...)
}
func (l *logger) Warn(ctx context.Context, s string, args ...interface{}) {
func (l *logger) Warn(_ context.Context, s string, args ...interface{}) {
l.r.Warn().Msgf(s, args...)
}
func (l *logger) Error(ctx context.Context, s string, args ...interface{}) {
func (l *logger) Error(_ context.Context, s string, args ...interface{}) {
l.r.Error().Msgf(s, args...)
}
func (l *logger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error) {
func (l *logger) Trace(_ context.Context, begin time.Time, fc func() (string, int64), err error) {
elapsed := time.Since(begin)
sql, _ := fc()
fields := gin.H{

View File

@@ -49,10 +49,7 @@ func (c *Component) Start() error {
if err := c.db.AutoMigrate(&SavedFilter{}); err != nil {
return fmt.Errorf("cannot migrate database: %w", err)
}
if err := c.populate(); err != nil {
return err
}
return nil
return c.populate()
}
// Stop stops the database component.