Skip to content

Commit dd4a7fc

Browse files
committed
Avoid unwanted type conversion
Signed-off-by: Humble Chirammal <[email protected]>
1 parent 87c9b20 commit dd4a7fc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

iscsi/iscsi.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func EnableDebugLogging(writer io.Writer) {
7777

7878
// parseSession takes the raw stdout from the iscsiadm -m session command and encodes it into an iscsi session type
7979
func parseSessions(lines string) []iscsiSession {
80-
entries := strings.Split(strings.TrimSpace(string(lines)), "\n")
80+
entries := strings.Split(strings.TrimSpace(lines), "\n")
8181
r := strings.NewReplacer("[", "",
8282
"]", "")
8383

@@ -458,7 +458,7 @@ func GetConnectorFromFile(filePath string) (*Connector, error) {
458458

459459
}
460460
data := Connector{}
461-
err = json.Unmarshal([]byte(f), &data)
461+
err = json.Unmarshal(f, &data)
462462
if err != nil {
463463
return &Connector{}, err
464464
}

iscsi/iscsiadm.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func Discoverydb(tp, iface string, discoverySecrets Secrets, chapDiscovery bool)
116116
baseArgs := []string{"-m", "discoverydb", "-t", "sendtargets", "-p", tp, "-I", iface}
117117
out, err := iscsiCmd(append(baseArgs, []string{"-o", "new"}...)...)
118118
if err != nil {
119-
return fmt.Errorf("failed to create new entry of target in discoverydb, output: %v, err: %v", string(out), err)
119+
return fmt.Errorf("failed to create new entry of target in discoverydb, output: %v, err: %v", out, err)
120120
}
121121

122122
if chapDiscovery {

0 commit comments

Comments
 (0)