Closed yangmingbai closed 3 years ago
Can you post your entire code?
well ,now i know because the f5 devices version is different, i'll get different field type,so it causes JSON parse error, for example:
type ServerSSLProfile struct{
TmOptions []string `json:"tmOptions,omitempty"`
}
type Node struct {
FQDN struct `json:"fqdn,omitempty"`
}
in this function:
func (b *BigIP) getForEntity(e interface{}, path ...string) (error, bool) {
req := &APIRequest{
Method: "get",
URL: b.iControlPath(path),
ContentType: "application/json",
}
resp, err := b.APICall(req)
if err != nil {
var reqError RequestError
json.Unmarshal(resp, &reqError)
if reqError.Code == 404 {
return nil, false
}
return err, false
}
err = json.Unmarshal(resp, e)
if err != nil {
return err, false
}
return nil, true
}
thanks!
Sure thing :)
Hello!
when i run f5.ServerSSLProfiles() I got a panic error.