@@ -19,6 +19,7 @@ package main
1919import (
2020 "crypto/ecdsa"
2121 "encoding/json"
22+ "errors"
2223 "fmt"
2324 "os"
2425 "path/filepath"
@@ -147,7 +148,7 @@ func dnsSync(ctx *cli.Context) error {
147148
148149func dnsSign (ctx * cli.Context ) error {
149150 if ctx .NArg () < 2 {
150- return fmt . Errorf ("need tree definition directory and key file as arguments" )
151+ return errors . New ("need tree definition directory and key file as arguments" )
151152 }
152153 var (
153154 defdir = ctx .Args ().Get (0 )
@@ -201,7 +202,7 @@ func directoryName(dir string) string {
201202// dnsToTXT performs dnsTXTCommand.
202203func dnsToTXT (ctx * cli.Context ) error {
203204 if ctx .NArg () < 1 {
204- return fmt . Errorf ("need tree definition directory as argument" )
205+ return errors . New ("need tree definition directory as argument" )
205206 }
206207 output := ctx .Args ().Get (1 )
207208 if output == "" {
@@ -218,7 +219,7 @@ func dnsToTXT(ctx *cli.Context) error {
218219// dnsToCloudflare performs dnsCloudflareCommand.
219220func dnsToCloudflare (ctx * cli.Context ) error {
220221 if ctx .NArg () != 1 {
221- return fmt . Errorf ("need tree definition directory as argument" )
222+ return errors . New ("need tree definition directory as argument" )
222223 }
223224 domain , t , err := loadTreeDefinitionForExport (ctx .Args ().Get (0 ))
224225 if err != nil {
@@ -231,7 +232,7 @@ func dnsToCloudflare(ctx *cli.Context) error {
231232// dnsToRoute53 performs dnsRoute53Command.
232233func dnsToRoute53 (ctx * cli.Context ) error {
233234 if ctx .NArg () != 1 {
234- return fmt . Errorf ("need tree definition directory as argument" )
235+ return errors . New ("need tree definition directory as argument" )
235236 }
236237 domain , t , err := loadTreeDefinitionForExport (ctx .Args ().Get (0 ))
237238 if err != nil {
@@ -244,7 +245,7 @@ func dnsToRoute53(ctx *cli.Context) error {
244245// dnsNukeRoute53 performs dnsRoute53NukeCommand.
245246func dnsNukeRoute53 (ctx * cli.Context ) error {
246247 if ctx .NArg () != 1 {
247- return fmt . Errorf ("need domain name as argument" )
248+ return errors . New ("need domain name as argument" )
248249 }
249250 client := newRoute53Client (ctx )
250251 return client .deleteDomain (ctx .Args ().First ())
@@ -363,10 +364,10 @@ func loadTreeDefinitionForExport(dir string) (domain string, t *dnsdisc.Tree, er
363364// tree's signature if valid.
364365func ensureValidTreeSignature (t * dnsdisc.Tree , pubkey * ecdsa.PublicKey , sig string ) error {
365366 if sig == "" {
366- return fmt . Errorf ("missing signature, run 'devp2p dns sign' first" )
367+ return errors . New ("missing signature, run 'devp2p dns sign' first" )
367368 }
368369 if err := t .SetSignature (pubkey , sig ); err != nil {
369- return fmt . Errorf ("invalid signature on tree, run 'devp2p dns sign' to update it" )
370+ return errors . New ("invalid signature on tree, run 'devp2p dns sign' to update it" )
370371 }
371372 return nil
372373}
0 commit comments