GoAdminGroup / go-admin

Printf-like function without f suffix GO-W6006
Bug risk
Major
a month agoa month old
printf-like formatting function 'PanicCtx' should be named 'PanicCtxf'
348}
349
350// PanicCtx print the panic message with ctx.
351func PanicCtx(ctx *context.Context, format string, args ...interface{}) {352	logCtx(ctx, logger.logger.Panic, format, args...)
353}
354
printf-like formatting function 'FatalCtx' should be named 'FatalCtxf'
329}
330
331// FatalCtx print the fatal message with ctx.
332func FatalCtx(ctx *context.Context, format string, args ...interface{}) {333	if !logger.errorLogOff && logger.Level <= zapcore.FatalLevel {
334		logCtx(ctx, logger.logger.Fatal, format, args...)
335	}
printf-like formatting function 'ErrorCtx' should be named 'ErrorCtxf'
308}
309
310// ErrorCtx print the error message with ctx.
311func ErrorCtx(ctx *context.Context, format string, args ...interface{}) {312	if !logger.errorLogOff && logger.Level <= zapcore.ErrorLevel {
313		logCtx(ctx, logger.logger.Error, format, args...)
314	}
printf-like formatting function 'WarnCtx' should be named 'WarnCtxf'
287}
288
289// WarnCtx print the warning message with ctx.
290func WarnCtx(ctx *context.Context, format string, args ...interface{}) {291	if !logger.infoLogOff && logger.Level <= zapcore.WarnLevel {
292		logCtx(ctx, logger.logger.Warn, format, args...)
293	}
printf-like formatting function 'logCtx' should be named 'logCtxf'
268
269type logFunc func(msg string, fields ...zapcore.Field)
270
271func logCtx(ctx *context.Context, logFunc logFunc, format string, args ...interface{}) {272	logFunc(fmt.Sprintf(format, args...), zap.String("traceID", trace.GetTraceID(ctx)))
273}
274