all: consistently use 'any' instead of 'interface{}'

'any' type is supported starting from Go1.18. Let's consistently use it
instead of 'interface{}' type across the code base, since `any` is easier to read than 'interface{}'.
This commit is contained in:
Aliaksandr Valialkin
2024-07-10 00:14:15 +02:00
parent 08c32232a6
commit 3c02937a34
97 changed files with 281 additions and 288 deletions

View File

@@ -186,7 +186,7 @@ func whetherToCloseConn(r *http.Request) bool {
return ok && fasttime.UnixTimestamp() > *deadline
}
var connDeadlineTimeKey = interface{}("connDeadlineSecs")
var connDeadlineTimeKey = any("connDeadlineSecs")
// Stop stops the http server on the given addrs, which has been started via Serve func.
func Stop(addrs []string) error {
@@ -617,7 +617,7 @@ func (rwa *responseWriterWithAbort) abort() {
}
// Errorf writes formatted error message to w and to logger.
func Errorf(w http.ResponseWriter, r *http.Request, format string, args ...interface{}) {
func Errorf(w http.ResponseWriter, r *http.Request, format string, args ...any) {
errStr := fmt.Sprintf(format, args...)
remoteAddr := GetQuotedRemoteAddr(r)
requestURI := GetRequestURI(r)