Refactor: lrucache use generics

This commit is contained in:
yaling888
2022-04-05 20:23:16 +08:00
committed by Meta
parent 14878b37f6
commit 673541e2a8
8 changed files with 106 additions and 97 deletions

View File

@ -16,7 +16,7 @@ import (
D "github.com/miekg/dns"
)
func putMsgToCache(c *cache.LruCache, key string, msg *D.Msg) {
func putMsgToCache(c *cache.LruCache[string, *D.Msg], key string, msg *D.Msg) {
var ttl uint32
switch {
case len(msg.Answer) != 0: