@@ -6,17 +6,17 @@ import (
66 "reflect"
77)
88
9- var debugPrinter interface {}
9+ var debugPrinter any
1010
1111// EnableDebug enables debug and optionally
1212// sets a custom printer to print out debug messages.
1313// The "printer" can be any compatible printer such as
1414// the standard `log.Logger` or a custom one like the `kataras/golog`.
1515//
1616// A "printer" is compatible when it contains AT LEAST ONE of the following methods:
17- // Debugf(string, ...interface{} ) or
18- // Logf(string, ...interface{} ) or
19- // Printf(string, ...interface{} )
17+ // Debugf(string, ...any ) or
18+ // Logf(string, ...any ) or
19+ // Printf(string, ...any )
2020//
2121// If EnableDebug is called but the "printer" value is nil
2222// then neffos will print debug messages through a new log.Logger prefixed with "| neffos |".
@@ -25,7 +25,7 @@ var debugPrinter interface{}
2525// Therefore enabling the debugger has zero performance cost on up-and-running servers and clients.
2626//
2727// There is no way to disable the debug mode on serve-time.
28- func EnableDebug (printer interface {} ) {
28+ func EnableDebug (printer any ) {
2929 if debugEnabled () {
3030 Debugf ("debug mode is already set" )
3131 return
@@ -46,13 +46,13 @@ func EnableDebug(printer interface{}) {
4646
4747type (
4848 debugfer interface {
49- Debugf (string , ... interface {} )
49+ Debugf (string , ... any )
5050 }
5151 logfer interface {
52- Logf (string , ... interface {} )
52+ Logf (string , ... any )
5353 }
5454 printfer interface {
55- Printf (string , ... interface {} )
55+ Printf (string , ... any )
5656 }
5757)
5858
@@ -62,7 +62,7 @@ func debugEnabled() bool {
6262
6363// Debugf prints debug messages to the printer defined on `EnableDebug`.
6464// Runs only on debug mode.
65- func Debugf (format string , args ... interface {} ) {
65+ func Debugf (format string , args ... any ) {
6666 if ! debugEnabled () {
6767 return
6868 }
@@ -89,7 +89,7 @@ func Debugf(format string, args ...interface{}) {
8989 }
9090}
9191
92- type dargs []interface {}
92+ type dargs []any
9393
9494// DebugEach prints debug messages for each of "mapOrSlice" elements
9595// to the printer defined on `EnableDebug`.
@@ -100,7 +100,7 @@ type dargs []interface{}
100100// fval := f.Interface()
101101// Debugf("field [%s.%s] will be automatically re-filled with [%T(%s)]", typ.Name(), typ.Field(idx).Name, fval, fval)
102102// })
103- func DebugEach (mapOrSlice interface {} , onDebugVisitor interface {} ) {
103+ func DebugEach (mapOrSlice any , onDebugVisitor any ) {
104104 if ! debugEnabled () || onDebugVisitor == nil {
105105 return
106106 }
0 commit comments