linters/internal/analyzers/noliteral/test-case/literals/negative._go
Alexander Chuprov 420dd98c24
All checks were successful
Tests and linters / Build lib (pull_request) Successful in 35s
Tests and linters / Lint (pull_request) Successful in 1m40s
Tests and linters / Tests (pull_request) Successful in 39s
Tests and linters / Staticcheck (pull_request) Successful in 4m8s
[#4] linters: Add check for source of constants
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
2023-08-04 14:26:40 +03:00

50 lines
No EOL
734 B
Text

package src_test
func (c *cfg) info_n() {
c.log.Info("logs.MSG") //unacceptable
}
func (c *cfg) info_n() {
log.Info("logs.MSG") //unacceptable
}
func (c *cfg) debug_n() {
c.log.Debug("logs.MSG") //unacceptable
}
func (c *cfg) error_n() {
c.log.Error("logs.MSG") //unacceptable
}
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) {
}
var logs = struct {
MSG string
}{
MSG: "some message",
}
type cfg struct {
log Logger
}