chore: upgrade coredns version (#550)

This commit is contained in:
naison
2025-04-19 10:06:56 +08:00
committed by GitHub
parent c42e3475f9
commit c9f1ce6522
1701 changed files with 235209 additions and 29271 deletions

View File

@@ -0,0 +1,25 @@
package patcher
import (
"time"
"github.com/expr-lang/expr/ast"
)
// WithTimezone passes Location to date() and now() functions.
type WithTimezone struct {
Location *time.Location
}
func (t WithTimezone) Visit(node *ast.Node) {
if btin, ok := (*node).(*ast.BuiltinNode); ok {
switch btin.Name {
case "date", "now":
loc := &ast.ConstantNode{Value: t.Location}
ast.Patch(node, &ast.BuiltinNode{
Name: btin.Name,
Arguments: append([]ast.Node{loc}, btin.Arguments...),
})
}
}
}