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:
Vojta Drbohlav 2021-12-06 18:45:34 +01:00 committed by GitHub
parent 215f6ed525
commit 899a34ddd4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 6 deletions

View file

@ -36,9 +36,6 @@ type apiErrorResponse struct {
Error []string `json:"error"`
}
type apiEmptyResponse struct {
}
type apiRequest struct {
method string
endpoint string
@ -98,7 +95,7 @@ func (restApi *dnsMadeEasyRestAPI) singleDomainCreate(data singleDomainRequestDa
req := &apiRequest{
method: "POST",
endpoint: fmt.Sprintf("dns/managed/"),
endpoint: "dns/managed/",
data: jsonData,
}

View file

@ -135,8 +135,8 @@ func toRecordConfig(domain string, record *recordResponseDataEntry) *models.Reco
} else if record.Type == "SRV" {
err = rc.SetTargetSRV(uint16(record.Priority), uint16(record.Weight), uint16(record.Port), record.Value)
} else if record.Type == "CAA" {
value, err := strconv.Unquote(record.Value)
if err != nil {
value, unquoteErr := strconv.Unquote(record.Value)
if unquoteErr != nil {
panic(err)
}
err = rc.SetTargetCAA(uint8(record.IssuerCritical), record.CaaType, value)