(response string)
| 508 | errAPI = errors.New("invalid response from API") |
| 509 | ) |
| 510 | |
| 511 | func parseResponse(response string) (string, error) { |
| 512 | s := strings.Split(strings.TrimSuffix(response, "\n"), "=") |
| 513 | if len(s) != 2 { |
| 514 | return "", errAPI |
| 515 | } |
| 516 | |
| 517 | return s[1], nil |
| 518 | } |
| 519 | |
| 520 | // formatHost ensures the device address is properly formatted for URL construction. |
no outgoing calls
searching dependent graphs…