Skip to content

Fix fmt.Sprintf brace escaping in find -exec commands - #1251

Closed
lklimek with Copilot wants to merge 3 commits into
feat/better-access-denied-error-handlingfrom
copilot/sub-pr-1249
Closed

lklimek with Copilot wants to merge 3 commits into
feat/better-access-denied-error-handlingfrom
copilot/sub-pr-1249

Conversation

Copilot AI commented Feb 9, 2026 •

Copy link
Copy Markdown
Contributor

Go's fmt.Sprintf treats {{}} literally, not as escaped braces. The error message helper was generating broken find commands.

Changes

  • Changed {{}} to {} in find -exec command suggestions in libs/os/perms.go

Example

Before (broken):

sudo find /path -type d -exec chmod 750 {{}} +

After (correct):

sudo find /path -type d -exec chmod 750 {} +

Addresses feedback from #1249.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits February 9, 2026 14:18
The double braces {{}} are treated literally by fmt.Sprintf and would
produce broken find commands. Go's fmt.Sprintf only treats % as special,
so {} should be used directly without escaping.

Co-authored-by: lklimek <[email protected]>
Copilot AI changed the title [WIP] Fix error handling based on feedback from original PR Fix fmt.Sprintf brace escaping in find -exec commands Feb 9, 2026
Copilot AI requested a review from lklimek February 9, 2026 14:23
@lklimek
lklimek marked this pull request as ready for review February 9, 2026 14:26
@lklimek lklimek closed this Feb 9, 2026
@lklimek
lklimek deleted the copilot/sub-pr-1249 branch November 10, 2026 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants