Skip to content

Conversation

Gofastasf
Copy link
Contributor

@Gofastasf Gofastasf commented Feb 2, 2025

Replaced strings.Replace with updated strings.ReplaceAll

Use filepath.Ext for file extension instead of strings.HasSuffix.

- Replaced os.Stat call and os.Create with os.OpenFile with O_EXCL to avoid TOCTOU.
- Improved logic to handle file size check only when the file exists.

Signed-off-by: Gofastasf <gofastasf@gmail.com>
Signed-off-by: Gofastasf <gofastasf@gmail.com>
Signed-off-by: Gofastasf <gofastasf@gmail.com>
@jaypipes
Copy link
Owner

jaypipes commented Feb 3, 2025

@Gofastasf please rebase this to main and update your PR summary :) thank you!

@Gofastasf Gofastasf changed the title Update code Improve string and file extension handling: ReplaceAll & filepath.Ext Feb 4, 2025
Copy link
Owner

@jaypipes jaypipes left a comment

Choose a reason for hiding this comment

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

Sorry for the long delay in merging this @Gofastasf, approved.

@jaypipes jaypipes merged commit de74ae5 into jaypipes:main Jul 3, 2025
12 of 14 checks passed
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