1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

Switch to Go 1.13 error wrapping (#604)

* Replaced errors.Wrap with fmt.Errorf (#589)

* Find:    errors\.Wrap\(([^,]+),\s+(["`][^"`]*)(["`])\)
  Replace: fmt.Errorf($2: %w$3, $1)

* Replaced errors.Wrapf with fmt.Errorf (#589)

* Find:    errors\.Wrapf\(([^,]+),\s+(["`][^"`]*)(["`])\)
  Replace: fmt.Errorf($2: %w$3, $1)
* Find:    errors\.Wrapf\(([^,]+),\s+(["`][^"`]*)(["`])(,[^)]+)\)
* Replace: fmt.Errorf($2: %w$3$4, $1)

* Replaced errors.Errorf with fmt.Errorf (#589)

* Find:    errors\.Errorf
  Replace: fmt.Errorf

* Cleaned up remaining imports

* Cleanup

* Regenerate provider support matrix

This was broken by #533 ... and it's now the third time this has been missed.
This commit is contained in:
Patrick Gaskin
2020-01-28 11:06:56 -05:00
committed by Tom Limoncelli
parent cae35a2c8f
commit 825ba2d081
64 changed files with 328 additions and 379 deletions

View File

@@ -7,14 +7,13 @@ import (
"strings"
"time"
adns "github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns"
aauth "github.com/Azure/go-autorest/autorest/azure/auth"
"github.com/Azure/go-autorest/autorest/to"
"github.com/StackExchange/dnscontrol/v2/models"
"github.com/StackExchange/dnscontrol/v2/providers"
"github.com/StackExchange/dnscontrol/v2/providers/diff"
"github.com/pkg/errors"
adns "github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns"
aauth "github.com/Azure/go-autorest/autorest/azure/auth"
)
type azureDnsProvider struct {
@@ -258,7 +257,7 @@ func nativeToRecordType(recordType *string) adns.RecordType {
case "SOA":
return adns.SOA
default:
panic(errors.Errorf("rc.String rtype %v unimplemented", *recordType))
panic(fmt.Errorf("rc.String rtype %v unimplemented", *recordType))
}
}
@@ -337,7 +336,7 @@ func nativeToRecords(set *adns.RecordSet, origin string) []*models.RecordConfig
}
case "Microsoft.Network/dnszones/SOA":
default:
panic(errors.Errorf("rc.String rtype %v unimplemented", *set.Type))
panic(fmt.Errorf("rc.String rtype %v unimplemented", *set.Type))
}
return results
}
@@ -389,7 +388,7 @@ func recordToNative(recordKey models.RecordKey, recordConfig []*models.RecordCon
}
*recordSet.CaaRecords = append(*recordSet.CaaRecords, adns.CaaRecord{Value: to.StringPtr(rec.Target), Tag: to.StringPtr(rec.CaaTag), Flags: to.Int32Ptr(int32(rec.CaaFlag))})
default:
panic(errors.Errorf("rc.String rtype %v unimplemented", recordKey.Type))
panic(fmt.Errorf("rc.String rtype %v unimplemented", recordKey.Type))
}
}
return recordSet, nativeToRecordType(to.StringPtr(recordKey.Type))