You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Two of your types don't allow for implementing custom loggers outside of your package because the fields are internal to the package.
In particular:
typeValuerinterface {
getValue() interface{}
}
If this was instead:
typeValuerinterface {
Value() interface{}
}
then other packages could implement loggers that can access the value of the Valuer. As it is currently written, only loggers you define in your log package can access the value of a Valuer.
I get that you're using Valuer interface to get around passing any, but I think passing any would be better. Instead you've redefined any to be a struct, when newer versions of go already support any aliased to interface{}.
Additionally, LoggedError has internal fields and is not an interface. Recommend that this be changed from a struct to an interface.
Two of your types don't allow for implementing custom loggers outside of your package because the fields are internal to the package.
In particular:
If this was instead:
then other packages could implement loggers that can access the value of the
Valuer
. As it is currently written, only loggers you define in your log package can access the value of aValuer
.I get that you're using
Valuer
interface to get around passingany
, but I think passingany
would be better. Instead you've redefinedany
to be a struct, when newer versions of go already supportany
aliased tointerface{}
.Additionally,
LoggedError
has internal fields and is not an interface. Recommend that this be changed from a struct to an interface.instead consider:
I'm also not sure I understand the purpose of a
Nil()
func that always returnsnil
.The text was updated successfully, but these errors were encountered: