Answer the question
In order to leave comments, you need to log in
How to change the name of a function in the interface?
In the package that creates a connection to the database, I made an interface for the logger. So that when creating a connection, you can skip your logger, and errors in the database would be written to it:
type Logger interface {
Panic(err error)
}
Answer the question
In order to leave comments, you need to log in
It is impossible, because your implementation will not match the interface.
Alternatively, you can create your Panic function, and call your PanicErr in it, then this implementation will correspond to the interface
type Logger interface {
Panic(err error)
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question