package src_test import ( "fmt" "git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs" ) /*After upgrading to golangci-lint version 1.5.4 and adding linter configuration, it will be possible to get rid of 'magic repositories'*/ func (c *cfg) info_ok() { c.log.Info(logs.MSG) //acceptable } func (c *cfg) debug_ok() { c.log.Debug(logs.MSG) //acceptable } // issue: https://git.frostfs.info/TrueCloudLab/linters/issues/16. // Check that the check does not trigger a false positive for "zap.Error("literal")" passed as an argument. func (c *cfg) debug1_ok() { c.log.Debug(logs.MSG, zap.Stringer("cid", bkt.CID), zap.String("oid", obj.VersionID), zap.Error("literal")) } func (c *cfg) debug1_ok() { f(zap.Error("logs.MSG")) } func (c *cfg) error_ok() { c.log.Error(logs.MSG) //acceptable } func (c *cfg) custom_ok_const() { c.log.Abyr(logs.MSG) //acceptable } func (c *cfg) custom_ok_lit() { c.log.Abyr("logs.MSG") //acceptable } type Logger interface { Debug(msg string) Info(msg string) Warn(msg string) Error(msg string) Abyr(msg string) } type RealLogger struct{} func (l RealLogger) Debug(msg string) { } func (l RealLogger) Info(msg string) { } func (l RealLogger) Warn(msg string) { } func (l RealLogger) Error(msg string) { } func (l RealLogger) Abyr(msg string) { } type RealLogger struct{} func (l RealLogger) Info(msg string) { fmt.Println(msg) } var logs = struct { MSG string }{ MSG: "some message", } type cfg struct { log Logger }