Skip to content

Commit 5c75cdd

Browse files
committed
Fixed linter warns
1 parent 0c4397c commit 5c75cdd

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

cmd/arduino-router-client/main.go

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"strings"
2525

2626
"github.com/arduino/arduino-router/msgpackrpc"
27+
2728
"github.com/spf13/cobra"
2829
"gopkg.in/yaml.v3"
2930
)
@@ -67,24 +68,22 @@ func main() {
6768
yamlEncoder := yaml.NewEncoder(os.Stdout)
6869
yamlEncoder.SetIndent(2)
6970
fmt.Println("Sending parameters:")
70-
yamlEncoder.Encode(args)
71+
_ = yamlEncoder.Encode(args)
7172

7273
// Perfom request send
7374
if rpcResp, rpcErr, err := send(server, cliArgs[0], args.([]any), notification); err != nil {
7475
fmt.Println("Error sending request:", err)
7576
os.Exit(1)
76-
} else {
77-
if !notification {
78-
yamlEncoder := yaml.NewEncoder(os.Stdout)
79-
yamlEncoder.SetIndent(2)
80-
if rpcErr != nil {
81-
fmt.Println("Got RPC error response:")
82-
yamlEncoder.Encode(rpcErr)
83-
}
84-
if rpcResp != nil {
85-
fmt.Println("Got RPC response:")
86-
yamlEncoder.Encode(rpcResp)
87-
}
77+
} else if !notification {
78+
yamlEncoder := yaml.NewEncoder(os.Stdout)
79+
yamlEncoder.SetIndent(2)
80+
if rpcErr != nil {
81+
fmt.Println("Got RPC error response:")
82+
_ = yamlEncoder.Encode(rpcErr)
83+
}
84+
if rpcResp != nil {
85+
fmt.Println("Got RPC response:")
86+
_ = yamlEncoder.Encode(rpcResp)
8887
}
8988
}
9089
},

0 commit comments

Comments
 (0)