Skip to content

switch to /g10k or fallback to ~/.cache/g10k , fixes #234#235

Merged
TheMeier merged 1 commit into
masterfrom
fix_hardcoded_tmp
May 8, 2026
Merged

switch to /g10k or fallback to ~/.cache/g10k , fixes #234#235
TheMeier merged 1 commit into
masterfrom
fix_hardcoded_tmp

Conversation

@xorpaul

@xorpaul xorpaul commented Apr 16, 2025

Copy link
Copy Markdown
Contributor

No description provided.

@xorpaul xorpaul mentioned this pull request Apr 16, 2025

@ekohl ekohl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not very familiar with go, but from reading this looks correct to me, assuming checkDirAndCreate behaves like mkdir -p. I see os.MkdirAll so that should be covered.

The only consideration I thought about was root usage, which maybe should use /var/cache but then again: I don't think g10k should ever run as root and drop privileges instead. And previously it always used /tmp/g10k so this is already better for multi user systems.

I see in the README there are a lot of mentions of the cache in README and I wonder if that needs to be updated. On the other hand, it doesn't explicitly mention the default value.

@jay7x

jay7x commented Apr 30, 2026

Copy link
Copy Markdown
Member

@voxpupuli/g10k I'd merge this. Please comment if any objections.

@TheMeier

TheMeier commented May 1, 2026

Copy link
Copy Markdown
Contributor

There is a better way available now https://pkg.go.dev/os#UserCacheDir

@ekohl

ekohl commented May 1, 2026

Copy link
Copy Markdown
Member

Oh, added in Go 1.11. That should be very safe to rely on by now.

@TheMeier TheMeier force-pushed the fix_hardcoded_tmp branch from bbd2518 to ef07c92 Compare May 7, 2026 14:20
@TheMeier TheMeier requested review from ekohl and jay7x May 7, 2026 14:21
Comment thread g10k.go Outdated
Co-Authored-By: Christoph Maser <christoph.maser+github@gmail.com>
Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
@TheMeier TheMeier force-pushed the fix_hardcoded_tmp branch from ef07c92 to e3c6450 Compare May 8, 2026 08:00
@TheMeier TheMeier merged commit bd8f7f2 into master May 8, 2026
8 checks passed
@ekohl ekohl linked an issue May 8, 2026 that may be closed by this pull request
@ekohl ekohl deleted the fix_hardcoded_tmp branch May 8, 2026 09:22
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.

hardcoded /tmp

4 participants