returnfmt.Errorf("unable to find the main domain for: %s",domain)
}
query:=u.Query()
query.Set("domains",mainDomain)
query.Set("token",token)
query.Set("clear",strconv.FormatBool(clear))
query.Set("txt",txt)
u.RawQuery=query.Encode()
response,err:=d.config.HTTPClient.Get(u.String())
iferr!=nil{
returnerr
}
deferresponse.Body.Close()
bodyBytes,err:=ioutil.ReadAll(response.Body)
iferr!=nil{
returnerr
}
body:=string(bodyBytes)
ifbody!="OK"{
returnfmt.Errorf("request to change TXT record for DuckDNS returned the following result (%s) this does not match expectation (OK) used url [%s]",body,u)