Skip to content

Commit

Permalink
fix tests (rule lines updated)
Browse files Browse the repository at this point in the history
  • Loading branch information
quasilyte committed Oct 12, 2021
1 parent bdf083c commit e6a9d2d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
12 changes: 6 additions & 6 deletions _test/regress/issue103/expected.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/root/target.go:20:2: logrus: logger.WithError(err).Error(...) (rules.go:13)
/root/target.go:20:2: logrus: logger.WithError(err).Error(...) (rules.go:14)
20 logger.Error(err)
/root/target.go:22:2: logrus: logger.WithError(fmt.Errorf("wrap: %w", err)).Error(...) (rules.go:13)
/root/target.go:22:2: logrus: logger.WithError(fmt.Errorf("wrap: %w", err)).Error(...) (rules.go:14)
22 logger.Error(fmt.Errorf("wrap: %w", err))
/root/target.go:25:2: loggerType: testLoggerType called with *logrus.Logger (rules.go:24)
25 testLoggerType(logger)
/root/target.go:29:2: logrus: loggerEntry.WithError(err).Error(...) (rules.go:13)
/root/target.go:29:2: logrus: loggerEntry.WithError(err).Error(...) (rules.go:14)
29 loggerEntry.Error(err)
/root/target.go:31:2: logrus: loggerEntry.WithError(fmt.Errorf("wrap: %w", err)).Error(...) (rules.go:13)
/root/target.go:31:2: logrus: loggerEntry.WithError(fmt.Errorf("wrap: %w", err)).Error(...) (rules.go:14)
31 loggerEntry.Error(fmt.Errorf("wrap: %w", err))
/root/target.go:38:2: logrus: loggerIface.WithError(err).Error(...) (rules.go:13)
/root/target.go:38:2: logrus: loggerIface.WithError(err).Error(...) (rules.go:14)
38 loggerIface.Error(err)
/root/target.go:40:2: logrus: loggerIface.WithError(fmt.Errorf("wrap: %w", err)).Error(...) (rules.go:13)
/root/target.go:40:2: logrus: loggerIface.WithError(fmt.Errorf("wrap: %w", err)).Error(...) (rules.go:14)
40 loggerIface.Error(fmt.Errorf("wrap: %w", err))
12 changes: 6 additions & 6 deletions _test/regress/issue103/expected2.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/root/target.go:20:2: logrus: logger.WithError(err).Error(...) (rules2.go:10)
/root/target.go:20:2: logrus: logger.WithError(err).Error(...) (rules2.go:11)
20 logger.Error(err)
/root/target.go:22:2: logrus: logger.WithError(fmt.Errorf("wrap: %w", err)).Error(...) (rules2.go:10)
/root/target.go:22:2: logrus: logger.WithError(fmt.Errorf("wrap: %w", err)).Error(...) (rules2.go:11)
22 logger.Error(fmt.Errorf("wrap: %w", err))
/root/target.go:25:2: loggerType: testLoggerType called with *logrus.Logger (rules2.go:21)
25 testLoggerType(logger)
/root/target.go:29:2: logrus: loggerEntry.WithError(err).Error(...) (rules2.go:10)
/root/target.go:29:2: logrus: loggerEntry.WithError(err).Error(...) (rules2.go:11)
29 loggerEntry.Error(err)
/root/target.go:31:2: logrus: loggerEntry.WithError(fmt.Errorf("wrap: %w", err)).Error(...) (rules2.go:10)
/root/target.go:31:2: logrus: loggerEntry.WithError(fmt.Errorf("wrap: %w", err)).Error(...) (rules2.go:11)
31 loggerEntry.Error(fmt.Errorf("wrap: %w", err))
/root/target.go:38:2: logrus: loggerIface.WithError(err).Error(...) (rules2.go:10)
/root/target.go:38:2: logrus: loggerIface.WithError(err).Error(...) (rules2.go:11)
38 loggerIface.Error(err)
/root/target.go:40:2: logrus: loggerIface.WithError(fmt.Errorf("wrap: %w", err)).Error(...) (rules2.go:10)
/root/target.go:40:2: logrus: loggerIface.WithError(fmt.Errorf("wrap: %w", err)).Error(...) (rules2.go:11)
40 loggerIface.Error(fmt.Errorf("wrap: %w", err))
7 changes: 4 additions & 3 deletions _test/regress/issue193/expected.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/root/target.go:29:8: stringerLiteral: Foo implements stringer (string-rule.go:17)
/root/target.go:33:2: logWithUnstructuredError: Errors must be logged as a structured field. Use zap.Error(err) or With(zap.Error(err)) (log-rule.go:17)
/root/target.go:34:2: logWithUnstructuredError: Errors must be logged as a structured field. Use zap.Error(err) or With(zap.Error(err)) (log-rule.go:17)
/root/target.go:36:22: workerLiteral: Bar implements worker (worker-rule.go:17)
/root/target.go:33:2: logWithUnstructuredError: Errors must be logged as a structured field. Use zap.Error(err) or With(zap.Error(err)) (log-rule.go:18)
/root/target.go:34:2: logWithUnstructuredError: Errors must be logged as a structured field. Use zap.Error(err) or With(zap.Error(err)) (log-rule.go:18)
/root/target.go:35:2: logWithUnstructuredError: Errors must be logged as a structured field. Use zap.Error(err) or With(zap.Error(err)) (log-rule.go:19)
/root/target.go:37:22: workerLiteral: Bar implements worker (worker-rule.go:17)
1 change: 1 addition & 0 deletions _test/regress/issue193/target.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func main() {
var err error
sugar.Info(err)
sugar.Info(err, "")
sugar.Info(err.Error(), "")

var w rg1.Worker = &Bar{}
w.Run()
Expand Down

0 comments on commit e6a9d2d

Please sign in to comment.