mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
DNSMADEEASY: Fix staticcheck errors (#1316)
* DNSMADEEASY: remove unused type apiEmptyResponse * DNSMADEEASY: fix unnecessary use of fmt.Sprintf * DNSMADEEASY: fix error check in toRecordConfig
This commit is contained in:
@@ -36,9 +36,6 @@ type apiErrorResponse struct {
|
|||||||
Error []string `json:"error"`
|
Error []string `json:"error"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type apiEmptyResponse struct {
|
|
||||||
}
|
|
||||||
|
|
||||||
type apiRequest struct {
|
type apiRequest struct {
|
||||||
method string
|
method string
|
||||||
endpoint string
|
endpoint string
|
||||||
@@ -98,7 +95,7 @@ func (restApi *dnsMadeEasyRestAPI) singleDomainCreate(data singleDomainRequestDa
|
|||||||
|
|
||||||
req := &apiRequest{
|
req := &apiRequest{
|
||||||
method: "POST",
|
method: "POST",
|
||||||
endpoint: fmt.Sprintf("dns/managed/"),
|
endpoint: "dns/managed/",
|
||||||
data: jsonData,
|
data: jsonData,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -135,8 +135,8 @@ func toRecordConfig(domain string, record *recordResponseDataEntry) *models.Reco
|
|||||||
} else if record.Type == "SRV" {
|
} else if record.Type == "SRV" {
|
||||||
err = rc.SetTargetSRV(uint16(record.Priority), uint16(record.Weight), uint16(record.Port), record.Value)
|
err = rc.SetTargetSRV(uint16(record.Priority), uint16(record.Weight), uint16(record.Port), record.Value)
|
||||||
} else if record.Type == "CAA" {
|
} else if record.Type == "CAA" {
|
||||||
value, err := strconv.Unquote(record.Value)
|
value, unquoteErr := strconv.Unquote(record.Value)
|
||||||
if err != nil {
|
if unquoteErr != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
err = rc.SetTargetCAA(uint8(record.IssuerCritical), record.CaaType, value)
|
err = rc.SetTargetCAA(uint8(record.IssuerCritical), record.CaaType, value)
|
||||||
|
|||||||
Reference in New Issue
Block a user