How do I default to time.Now()
for time flags
#206
Answered
by
alecthomas
midnightexigent
asked this question in
Q&A
-
In general, is there a way to provide a path to a function whose call that returns the default value ? |
Beta Was this translation helpful? Give feedback.
Answered by
alecthomas
Sep 14, 2021
Replies: 1 comment
-
I would use a variable for this: var cli struct {
Now time.Time `default:"${now}"`
}
kong.Parse(cli, kong.Vars{"now": time.Now().String()}) (off the top of my head - may need some tweaking to actually work) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
alecthomas
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I would use a variable for this:
(off the top of my head - may need some tweaking to actually work)