Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d8514b7

Browse files
authored
Merge pull request #37 from mqtt-viewer/fix/writing-protobuf-files-linux
fix protobuf files not loading correctly in some cases
2 parents beb4dcd + 7225591 commit d8514b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backend/protobuf/write_files.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func WriteSparkplugProtoFiles(resourcePath string) error {
2222
// Check if the directory exists
2323
if _, err := os.Stat(protoDirPath); os.IsNotExist(err) {
2424
// Create the directory if it doesn't exist
25-
if err := os.MkdirAll(protoDirPath, 0644); err != nil {
25+
if err := os.MkdirAll(protoDirPath, os.ModePerm); err != nil {
2626
return err
2727
}
2828
}
@@ -50,7 +50,7 @@ func writeFile(path string, bytes []byte) error {
5050
}
5151

5252
// Write the embedded file to the specified path
53-
if err := os.WriteFile(path, bytes, 0644); err != nil {
53+
if err := os.WriteFile(path, bytes, os.ModePerm); err != nil {
5454
return err
5555
}
5656
return nil

0 commit comments

Comments
 (0)