[go-nuts] Re: YAML Unmarshal changes keys

2022-04-11 Thread vika...@gmail.com
ted behavior, such as what you > observed. > > On Sunday, April 10, 2022 at 11:53:57 PM UTC-5 vika...@gmail.com wrote: > >> I am new to GoLang and looking to join two keys (rules) from two >> different Yamls. >> >> I have been able to join the keys but

[go-nuts] YAML Unmarshal changes keys

2022-04-10 Thread vika...@gmail.com
I am new to GoLang and looking to join two keys (rules) from two different Yamls. I have been able to join the keys but I found that Unmarshal changes the keys (example apiVersion to APIVersion, and kind to Kind). Overall, my goal is to have a valid Kubernetes YAML manifest. This is what I

Re: [go-nuts] Convert string to time.Duration

2022-04-04 Thread vika...@gmail.com
Thanks all for the hint and the snippets. I am all set now. On Tuesday, 5 April 2022 at 00:13:46 UTC+10 tay...@fastmail.com wrote: > Take a look at time.ParseDuration and its example: > https://pkg.go.dev/time#ParseDuration > > On Sun, Apr 3, 2022, at 3:48 PM, vika...@gmail.com wro

[go-nuts] Convert string to time.Duration

2022-04-03 Thread vika...@gmail.com
I am looking to convert a *string* (say 4) to type *time.Duration*. I've looked around but could not find a way to do so. // https://go.dev/play/p/EUuDAY-Qx8N package main import ( "fmt" "time" ) func main() { // var addHours string = 4 fmt.Println(time.Now().Local())