Skip to content

Commit

Permalink
Fix gosec warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
DerAndereAndi committed Jan 22, 2024
1 parent 10a6b82 commit baad1d5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion integration_tests/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func initialCommunication(t *testing.T, remoteDevice api.DeviceRemote, writeHand
}

func loadFileData(t *testing.T, fileName string) []byte {
fileData, err := os.ReadFile(fileName)
fileData, err := os.ReadFile(fileName) // #nosec G304
if err != nil {
t.Fatal(err)
}
Expand Down
6 changes: 4 additions & 2 deletions model/commondatatypes_additions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package model
import (
"testing"
"time"

"github.com/enbility/spine-go/util"
)

func TestTimeType(t *testing.T) {
Expand Down Expand Up @@ -269,9 +271,9 @@ func TestFeatureAddressTypeString(t *testing.T) {

for _, tc := range tc {
f := FeatureAddressType{
Device: &tc.device,
Device: util.Ptr(tc.device),
Entity: tc.entity,
Feature: &tc.feature,
Feature: util.Ptr(tc.feature),
}

got := f.String()
Expand Down
4 changes: 2 additions & 2 deletions spine/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (t *WriteMessageHandler) ResultWithReference(msgCounterReference *model.Msg
}

func loadFileData(t *testing.T, fileName string) []byte {
fileData, err := os.ReadFile(fileName)
fileData, err := os.ReadFile(fileName) // #nosec G304
if err != nil {
t.Fatal(err)
}
Expand All @@ -110,7 +110,7 @@ func loadFileData(t *testing.T, fileName string) []byte {
}

func checkSentData(t *testing.T, sendBytes []byte, msgSendFilePrefix string) {
msgSendExpectedBytes, err := os.ReadFile(msgSendFilePrefix + "_expected.json")
msgSendExpectedBytes, err := os.ReadFile(msgSendFilePrefix + "_expected.json") // #nosec G304
if err != nil {
t.Fatal(err)
}
Expand Down

0 comments on commit baad1d5

Please sign in to comment.