Skip to content

Commit a086426

Browse files
author
Chetan_konaganahalli
committed
Fixed errors
1 parent 186c3a1 commit a086426

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

internal/callgraph/language/golang/strategy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func NewStrategy(config conf.IConfig, paths []string, exclusions []string, inclu
7474
}
7575

7676
func strategyWarning(errMsg string) {
77-
err := fmt.Errorf(errMsg)
77+
err := fmt.Errorf("%s", errMsg)
7878
warningColor := color.New(color.FgYellow, color.Bold).SprintFunc()
7979
defaultOutputWriter := log.Writer()
8080
log.Println(warningColor("Warning: ") + err.Error())

internal/callgraph/language/java/soot_handler_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func TestInitializeSootWrapper(t *testing.T) {
2323

2424
func TestInitializeSootWrapperOpenEmbedError(t *testing.T) {
2525
errString := "fs open embed error"
26-
fsMock := ioTestData.FileSystemMock{FsOpenEmbedError: fmt.Errorf(errString)} //nolint
26+
fsMock := ioTestData.FileSystemMock{FsOpenEmbedError: fmt.Errorf("%s", errString)} //nolint
2727
tempDir, err := fsMock.MkdirTemp(".tmp")
2828
assert.NoError(t, err)
2929
_, err = sootHandler.initializeSootWrapper(fsMock, tempDir)
@@ -33,7 +33,7 @@ func TestInitializeSootWrapperOpenEmbedError(t *testing.T) {
3333

3434
func TestInitializeSootWrapperFsReadAllError(t *testing.T) {
3535
errString := "fs read all error"
36-
fsMock := ioTestData.FileSystemMock{FsReadAllError: fmt.Errorf(errString)} //nolint
36+
fsMock := ioTestData.FileSystemMock{FsReadAllError: fmt.Errorf("%s", errString)} //nolint
3737
tempDir, err := fsMock.MkdirTemp(".tmp")
3838
assert.NoError(t, err)
3939
_, err = sootHandler.initializeSootWrapper(fsMock, tempDir)
@@ -43,7 +43,7 @@ func TestInitializeSootWrapperFsReadAllError(t *testing.T) {
4343

4444
func TestInitializeSootWrapperFsWriteFileError(t *testing.T) {
4545
errString := "fs write file error"
46-
fsMock := ioTestData.FileSystemMock{FsWriteFileError: fmt.Errorf(errString)} //nolint
46+
fsMock := ioTestData.FileSystemMock{FsWriteFileError: fmt.Errorf("%s", errString)} //nolint
4747
tempDir, err := fsMock.MkdirTemp(".tmp")
4848
assert.NoError(t, err)
4949
_, err = sootHandler.initializeSootWrapper(fsMock, tempDir)
@@ -60,7 +60,7 @@ func TestDownloadSootWrapper(t *testing.T) {
6060

6161
func TestDownloadSootWrapperMkdirTempError(t *testing.T) {
6262
errString := "mkdir temp error"
63-
fsMock := ioTestData.FileSystemMock{MkdirTempError: fmt.Errorf(errString)} //nolint
63+
fsMock := ioTestData.FileSystemMock{MkdirTempError: fmt.Errorf("%s", errString)} //nolint
6464
arcMock := ioTestData.ArchiveMock{}
6565
err := sootHandler.downloadSootWrapper(arcMock, fsMock, "soot-wrapper.jar", "11")
6666
assert.Error(t, err)
@@ -69,7 +69,7 @@ func TestDownloadSootWrapperMkdirTempError(t *testing.T) {
6969

7070
func TestDownloadSootWrapperCreateError(t *testing.T) {
7171
errString := "create error"
72-
fsMock := ioTestData.FileSystemMock{CreateError: fmt.Errorf(errString)} //nolint
72+
fsMock := ioTestData.FileSystemMock{CreateError: fmt.Errorf("%s", errString)} //nolint
7373
arcMock := ioTestData.ArchiveMock{}
7474
err := sootHandler.downloadSootWrapper(arcMock, fsMock, "soot-wrapper.jar", "11")
7575
assert.Error(t, err)
@@ -79,7 +79,7 @@ func TestDownloadSootWrapperCreateError(t *testing.T) {
7979
func TestDownloadSootWrapperUnzipError(t *testing.T) {
8080
errString := "create error"
8181
fsMock := ioTestData.FileSystemMock{}
82-
arcMock := ioTestData.ArchiveMock{UnzipFileError: fmt.Errorf(errString)} //nolint
82+
arcMock := ioTestData.ArchiveMock{UnzipFileError: fmt.Errorf("%s", errString)} //nolint
8383
err := sootHandler.downloadSootWrapper(arcMock, fsMock, "soot-wrapper.jar", "11")
8484
assert.Error(t, err)
8585
assert.Equal(t, err.Error(), errString)
@@ -166,7 +166,7 @@ func TestGetSootWrapperInitialize(t *testing.T) {
166166

167167
func TestGetSootWrapperMkdirError(t *testing.T) {
168168
errString := "mkdir error"
169-
fsMock := ioTestData.FileSystemMock{MkdirError: fmt.Errorf(errString), StatError: fmt.Errorf(""), IsNotExistBool: true} //nolint
169+
fsMock := ioTestData.FileSystemMock{MkdirError: fmt.Errorf("%s", errString), StatError: fmt.Errorf("%s", ""), IsNotExistBool: true} //nolint
170170
arcMock := ioTestData.ArchiveMock{}
171171
sootHandler := SootHandler{}
172172
_, err := sootHandler.GetSootWrapper("11", fsMock, arcMock)

0 commit comments

Comments
 (0)