Skip to content
This repository has been archived by the owner on Apr 22, 2019. It is now read-only.

Possible misuse of ioutil.TempDir #2

Open
objectx opened this issue Sep 24, 2018 · 4 comments
Open

Possible misuse of ioutil.TempDir #2

objectx opened this issue Sep 24, 2018 · 4 comments

Comments

@objectx
Copy link
Contributor

objectx commented Sep 24, 2018

Don't hardcode /tmp. This will cause unexpected test failure on Windows.

# I'll check it on windows later. (at this time, no Windows station near me 😢)

# Appended

Under windows environment ioutil.TempDir("/tmp", ... cause error
image

@objectx objectx changed the title ioutil.TempDir should use the system default temporary directory Possible misuse of ioutil.TempDir Sep 24, 2018
@marc0der
Copy link
Member

marc0der commented Sep 24, 2018

To be fair, this will only be used for testing and needs to be in a place where we can easily examine the outcome in case of failure. Alternatively we could place this in the project folder (pwd) as a hidden .sdkman directory. wdyt?

@objectx
Copy link
Contributor Author

objectx commented Sep 25, 2018

I've created the #3 to run tests successfully on windows.

needs to be in a place where we can easily examine the outcome in case of failure.

System's default temporary directory (used by ioutil.TempDir) is determined by os.TempDir(). It not so difficult place to investigate.

we could place this in the project folder (pwd) as a hidden .sdkman directory.

I think writing something in the source tree is a bad thing.

@marc0der
Copy link
Member

Sure, but I also think that this is a lot of extra boilerplate, complexity and duplication for something that can be solved in a far simpler way. Shall we move these discussions to our Gitter channel before continuing?

@objectx
Copy link
Contributor Author

objectx commented Sep 25, 2018

@marc0der OK. Continuing in the Gitter channel…

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants