Skip to content

Fix: Use os.Lstat instead of os.Stat to support broken symlinks#106

Merged
babarot merged 1 commit intomainfrom
claude/resolve-issue-99-01Gme7ZJ2mrruwYZLxzfyREs
Dec 1, 2025
Merged

Fix: Use os.Lstat instead of os.Stat to support broken symlinks#106
babarot merged 1 commit intomainfrom
claude/resolve-issue-99-01Gme7ZJ2mrruwYZLxzfyREs

Conversation

@babarot
Copy link
Copy Markdown
Owner

@babarot babarot commented Dec 1, 2025

os.Stat follows symlinks and returns NotExist error when the target
doesn't exist, even if the symlink itself exists. This prevented gomi
from removing broken symlinks.

Using os.Lstat examines the symlink itself rather than following it,
allowing gomi to correctly detect and remove broken symlinks.

Fixes #99

os.Stat follows symlinks and returns NotExist error when the target
doesn't exist, even if the symlink itself exists. This prevented gomi
from removing broken symlinks.

Using os.Lstat examines the symlink itself rather than following it,
allowing gomi to correctly detect and remove broken symlinks.

Fixes #99
@babarot babarot added the kind/bug A bug; unintended behavior label Dec 1, 2025
@babarot babarot merged commit ea3bc46 into main Dec 1, 2025
5 checks passed
@babarot babarot deleted the claude/resolve-issue-99-01Gme7ZJ2mrruwYZLxzfyREs branch December 1, 2025 05:11
@github-actions github-actions bot mentioned this pull request Dec 1, 2025
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Feb 15, 2026
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [babarot/gomi](https://github.com/babarot/gomi) | patch | `v1.6.1` β†’ `v1.6.2` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>babarot/gomi (babarot/gomi)</summary>

### [`v1.6.2`](https://github.com/babarot/gomi/blob/HEAD/CHANGELOG.md#v162---2026-02-12)

[Compare Source](babarot/gomi@v1.6.1...v1.6.2)

##### Bug fixes

- Fix: Use os.Lstat instead of os.Stat to support broken symlinks by [@&#8203;babarot](https://github.com/babarot) in [#&#8203;106](babarot/gomi#106)

##### Others

- Fix dead link by [@&#8203;daaa1k](https://github.com/daaa1k) in [#&#8203;108](babarot/gomi#108)

</details>

---

### Configuration

πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

β™» **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

πŸ”• **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMC4zIiwidXBkYXRlZEluVmVyIjoiNDMuMTAuMyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6OnBhdGNoIl19-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug A bug; unintended behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gomi cannot remove broken symlinks

1 participant