7 Commits

Author SHA1 Message Date
Julio López
29d4118aac refactor(general): address potential conversion overflows (#5266)
Minor robustness improvements

- add safety check when converting file descriptor (`os.File.Fd()`) to `int`
- check that file descriptor returned by Open (on Linux) is non-negative before converting to `uintptr`. This addresses a linter warning for a most-likely-non-existent-edge-case of converting a negative file descriptor.
- check that parsed content IDs (hashes) do not exceed the maximum id hash length.
- add nolint annotation for safe conversion
2026-04-01 21:51:44 -07:00
Nathan Baulch
657fda216a chore(ci): upgrade to golangci-lint 2.6.1 (#4973)
- upgrade to golangci-lint 2.6.1
- updates for gosec
- updates for govet
- updates for perfsprint
- updates modernize

Leaves out modernize:omitempty due to conflicts with tests
2025-11-11 21:27:10 -08:00
Matthieu MOREL
8a176255c0 fix(general): enable wsl for all go files (#4524)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-04-26 13:01:20 -07:00
Julio López
e3fc6e012d refactor(general): leverage os.CreateTemp (#4513)
* use `os.CreateTemp` in `tempfile.CreateAutoDelete`
* refactor `TestTempFile`: add `VerifyTempfile` test helper
* add test for `createUnixFallback`
* rename function to `tempfile.CreateAutoDelete`
* remove the `dir` parameter to `tempfile.CreateAutoDelete`,
  only an empty string was passed, apart from test cases.
* guard against panic in TestShadowCopy
2025-04-22 20:55:11 -07:00
Julio López
97ff2a17fb fix(general): tempfile.Create on Linux (x64/arm64) (#4504)
- Add `TestCreateSucceedsWhenDirIsNotSpecified`
- Use `os.TempDir` when `dir` is not specified (empty string)

Ref:
- Fixes #4331
- Fixes #2415
2025-04-15 22:21:57 -07:00
Jarek Kowalski
dcf6d1c2e1 feat(general): always try O_TMPFILE on Linux when creating temporary files (#2407) 2022-09-14 09:48:02 -07:00
Jarek Kowalski
33fa5cbd50 feat(general): added tempfile package (#2402)
* feat(general): added tempfile package

* use tempfile.Create() in bigmap
2022-09-14 05:37:47 +00:00