[go-nuts] Re: unpacking map[string]interface{} answer

2021-05-31 Thread natxo....@gmail.com
ok, I think I understand how this library works, and posting this for future reference in case someone needs it. The library uses this other library: https://github.com/mitchellh/mapstructure So now I can do this and vim go will helpfully fill in the struct fields for me. client := foreman.Cl

[go-nuts] Re: unpacking map[string]interface{} answer

2021-05-30 Thread natxo....@gmail.com
hi, I got privately an answer to get the type of variable, so I tried this: client := foreman.Client("foreman.l.example.org", "admin", "whatever", false, "") resp, err := client.Get("hosts") if err != nil { fmt.Println(err) } fmt.Printf("%T\n", resp) and the