Skip to content

Commit

Permalink
Improve error in patchgc
Browse files Browse the repository at this point in the history
  • Loading branch information
Anonymous authored and eh-steve committed Jan 2, 2024
1 parent 7233482 commit 67105cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jit/gc_patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func PatchGC(goBinary string, debugLog bool) error {
err = os.WriteFile(flagPath, newFlagFile, flagFileStat.Mode())
if err != nil {
if strings.Contains(err.Error(), "permission denied") || strings.Contains(err.Error(), "not permitted") {
return fmt.Errorf("could not write patched '%s': %w\nTry changing $GOROOT's owner to current user, or run patch with sudo\ngo install github.com/eh-steve/goloader/jit/patchgc@latest && sudo $GOPATH/bin/patchgc", flagPath, err)
return fmt.Errorf("could not write patched '%s': %w\nTry changing $GOROOT's owner to current user with: \n\nsudo chown -R $USER:$USER $GOROOT\n\n or run patch with sudo:\ngo install github.com/eh-steve/goloader/jit/patchgc@latest && sudo $GOPATH/bin/patchgc", flagPath, err)
}
return fmt.Errorf("could not write patched '%s': %w", flagPath, err)
}
Expand Down

0 comments on commit 67105cf

Please sign in to comment.