Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

refactor: using standard libraries to do file operations #542

Merged
merged 1 commit into from
Oct 22, 2024

Conversation

apocelipes
Copy link
Contributor

Using standard libraries to get temp path and to do file operations.

This makes the program more simple and safer because standard libraries clean the path and no need to use outside commands.

It also makes the code more portable since not all systems use '/tmp' as its tempfile path (other places for example, '/data/local/tmp'). Many mordern Linux distros also support setting the env varibale '$TMPDIR' to change a program's tempfile path. So using the standard library's getTempDir function is a better idea, it's done all the works for us.

@boyter
Copy link
Owner

boyter commented Oct 22, 2024

Merging in although I never plan on running the Python script again and the Go code is exclusively running on linux. Thanks for the PR though!

@boyter boyter merged commit aa904f4 into boyter:master Oct 22, 2024
5 checks passed
@apocelipes apocelipes deleted the use-os branch October 22, 2024 00:53
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
Status: DONE
Development

Successfully merging this pull request may close these issues.

2 participants