Harden Go CLI subprocess behavior

This commit is contained in:
2026-05-10 23:33:13 +00:00
parent 08b7531149
commit 95fe8c32fa
4 changed files with 234 additions and 4 deletions

View File

@@ -14,9 +14,9 @@ func ReadRequiredFile(path string, label string) ([]byte, error) {
return contents, nil
}
func ValidateWellFormedJSON(raw []byte) error {
func ValidateWellFormedJSON(path string, raw []byte) error {
if !json.Valid(raw) {
return fmt.Errorf("transcript file is not valid JSON")
return fmt.Errorf("transcript file %q is not valid JSON", path)
}
return nil
}