mirror of
https://github.com/kubenetworks/kubevpn.git
synced 2025-10-13 02:53:52 +08:00
chore: upgrade coredns version (#550)
This commit is contained in:
25
vendor/github.com/expr-lang/expr/patcher/with_timezone.go
generated
vendored
Normal file
25
vendor/github.com/expr-lang/expr/patcher/with_timezone.go
generated
vendored
Normal 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...),
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user