mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 08:44:17 -04:00
chore(lint): modernize Go (#7536)
Use modern Go constructs through the modernize analyzer from the golang.org/x/tools package. Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>
This commit is contained in:
@@ -28,7 +28,7 @@ type RecordLatencyFunc func(meta.Object)
|
||||
// DefaultProcessor is based on the Process function from cache.NewIndexerInformer except it does a conversion.
|
||||
func DefaultProcessor(convert ToFunc, recordLatency *EndpointLatencyRecorder) ProcessorBuilder {
|
||||
return func(clientState cache.Indexer, h cache.ResourceEventHandler) cache.ProcessFunc {
|
||||
return func(obj interface{}, isInitialList bool) error {
|
||||
return func(obj any, isInitialList bool) error {
|
||||
for _, d := range obj.(cache.Deltas) {
|
||||
if recordLatency != nil {
|
||||
if o, ok := d.Object.(meta.Object); ok {
|
||||
@@ -59,7 +59,7 @@ func DefaultProcessor(convert ToFunc, recordLatency *EndpointLatencyRecorder) Pr
|
||||
recordLatency.record()
|
||||
}
|
||||
case cache.Deleted:
|
||||
var obj interface{}
|
||||
var obj any
|
||||
obj, ok := d.Object.(cache.DeletedFinalStateUnknown)
|
||||
if !ok {
|
||||
var err error
|
||||
|
||||
Reference in New Issue
Block a user