fix another old os use in when statement

This commit is contained in:
Laytan Laats
2026-02-27 22:11:11 +01:00
parent 3c84305e38
commit 6a6460e824

View File

@@ -1018,11 +1018,7 @@ To partly mitigate this, redirect STDERR to a file or use the -define:ODIN_TEST_
when JSON_REPORT != "" {
json_report: JSON
mode: int
when ODIN_OS != .Windows {
mode = os.S_IRUSR|os.S_IWUSR|os.S_IRGRP|os.S_IROTH
}
json_fd, err := os.open(JSON_REPORT, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, mode)
json_fd, err := os.open(JSON_REPORT, {.Write, .Create, .Trunc}, {.Read_User, .Write_User, .Read_Group, .Read_Other})
fmt.assertf(err == nil, "unable to open file %q for writing of JSON report, error: %v", JSON_REPORT, err)
defer os.close(json_fd)
@@ -1041,7 +1037,7 @@ To partly mitigate this, redirect STDERR to a file or use the -define:ODIN_TEST_
json_report.success = total_success_count
json_report.duration = finished_in
json_err := json.marshal_to_writer(os.stream_from_handle(json_fd), json_report, &{ pretty = true })
json_err := json.marshal_to_writer(os.to_stream(json_fd), json_report, &{ pretty = true })
fmt.assertf(json_err == nil, "Error writing JSON report: %v", json_err)
}