Skip to content

Commit f159f9e

Browse files
committed
FIX: Use CTNGoUtils GetFileBytes instead of custom function
1 parent bec33d8 commit f159f9e

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

utils/file.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,6 @@ func ForEachFileInDirRecursive(dir string, fn func(file os.FileInfo, dir string)
4343
})
4444
}
4545

46-
func GetFileBytes(filePath string) []byte {
47-
content, err := os.ReadFile(filePath)
48-
if err != nil {
49-
panic(err)
50-
}
51-
52-
return content
53-
}
54-
5546
// The path needs to be relative the the bitburner dir
5647
func GetFileContentByPath(path string) []byte {
5748
var filePath = fmt.Sprintf("%s/%s", constants.BitburnerRoot, path)
@@ -61,7 +52,7 @@ func GetFileContentByPath(path string) []byte {
6152
return []byte{}
6253
}
6354

64-
return GetFileBytes(filePath)
55+
return ctnfile.GetFileBytes(filePath)
6556
}
6657

6758
// Will return the content with any string termenating character escapes.

0 commit comments

Comments
 (0)