Skip to content

Commit 1fe92f4

Browse files
committed
refactor: use errors.New to replace fmt.Errorf with no parameters
Signed-off-by: LesCyber <andi4cing@gmail.com>
1 parent 490539e commit 1fe92f4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

auditevents/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package main
1818

1919
import (
2020
"encoding/json"
21+
"errors"
2122
"fmt"
2223
"io"
2324
"net/http"
@@ -94,7 +95,7 @@ func run(host string) error {
9495
protocolID := event.BlockchainEvent.ProtocolID
9596
fmt.Printf("%-10d %s\n", lastSequence, protocolID)
9697
if protocolID <= lastProtocolID {
97-
return fmt.Errorf("out of order events detected")
98+
return errors.New("out of order events detected")
9899
}
99100
lastProtocolID = protocolID
100101
validated++

ffconfig/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package main
1818

1919
import (
20+
"errors"
2021
"fmt"
2122
"os"
2223

@@ -29,7 +30,7 @@ var rootCmd = &cobra.Command{
2930
Short: "FireFly configuration tool",
3031
Long: "Tool for managing and migrating config files for Hyperledger FireFly",
3132
RunE: func(cmd *cobra.Command, args []string) error {
32-
return fmt.Errorf("a command is required")
33+
return errors.New("a command is required")
3334
},
3435
}
3536

0 commit comments

Comments
 (0)