Removed warnings from go staticcheck

This commit is contained in:
gezimbll
2023-11-03 12:20:48 -04:00
committed by Dan Christian Bogos
parent 529430bd4d
commit c2dacc42c1
97 changed files with 334 additions and 761 deletions

View File

@@ -99,15 +99,15 @@ func executeCommand(command string, client *rpcclient.RPCClient) {
if cmd.RpcMethod() != utils.EmptyString {
res := cmd.RpcResult()
param := cmd.RpcParams(false)
switch param.(type) {
switch p := param.(type) {
case *console.EmptyWrapper:
param = utils.EmptyString
case *console.StringWrapper:
param = param.(*console.StringWrapper).Item
param = p.Item
case *console.StringSliceWrapper:
param = param.(*console.StringSliceWrapper).Items
param = p.Items
case *console.StringMapWrapper:
param = param.(*console.StringMapWrapper).Items
param = p.Items
}
if rpcErr := client.Call(context.TODO(), cmd.RpcMethod(), param, res); rpcErr != nil {

View File

@@ -19,7 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
package main
import (
"bufio"
"bytes"
"io"
"log"
@@ -52,9 +51,8 @@ type FileReaderTester struct {
runs int
reqSep []byte
rdr io.Reader
conn net.Conn
connScnr *bufio.Scanner
rdr io.Reader
conn net.Conn
}
func (frt *FileReaderTester) connSendReq(req []byte) (err error) {