1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-12-24 10:07:21 +02:00

Add linting for any (#2893)

Add gofmt rules to make sure `interface{}` is not used but only `any`.
This commit is contained in:
qwerty287 2023-11-29 20:21:18 +01:00 committed by GitHub
parent 2200998ca4
commit 2f963d70e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 8 deletions

View File

@ -1,6 +1,9 @@
linters-settings:
gofmt:
simplify: true
rewrite-rules:
- pattern: interface{}
replacement: any
misspell:
locale: US
gofumpt:

View File

@ -22,34 +22,34 @@ import (
type xormigrateLogger struct{}
func (l *xormigrateLogger) Debug(v ...interface{}) {
func (l *xormigrateLogger) Debug(v ...any) {
log.Debug().Msg(fmt.Sprint(v...))
}
func (l *xormigrateLogger) Debugf(format string, v ...interface{}) {
func (l *xormigrateLogger) Debugf(format string, v ...any) {
log.Debug().Msgf(format, v...)
}
func (l *xormigrateLogger) Info(v ...interface{}) {
func (l *xormigrateLogger) Info(v ...any) {
log.Info().Msg(fmt.Sprint(v...))
}
func (l *xormigrateLogger) Infof(format string, v ...interface{}) {
func (l *xormigrateLogger) Infof(format string, v ...any) {
log.Info().Msgf(format, v...)
}
func (l *xormigrateLogger) Warn(v ...interface{}) {
func (l *xormigrateLogger) Warn(v ...any) {
log.Warn().Msg(fmt.Sprint(v...))
}
func (l *xormigrateLogger) Warnf(format string, v ...interface{}) {
func (l *xormigrateLogger) Warnf(format string, v ...any) {
log.Warn().Msgf(format, v...)
}
func (l *xormigrateLogger) Error(v ...interface{}) {
func (l *xormigrateLogger) Error(v ...any) {
log.Error().Msg(fmt.Sprint(v...))
}
func (l *xormigrateLogger) Errorf(format string, v ...interface{}) {
func (l *xormigrateLogger) Errorf(format string, v ...any) {
log.Error().Msgf(format, v...)
}