-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using tmp dir instead of GOPATH #72
Conversation
Codecov Report
@@ Coverage Diff @@
## master #72 +/- ##
==========================================
+ Coverage 97.00% 97.01% +0.01%
==========================================
Files 8 8
Lines 200 201 +1
==========================================
+ Hits 194 195 +1
Misses 4 4
Partials 2 2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
2b8ab36
to
a6136fa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @rafaelsq, thank you for the contribution
} | ||
for _, tt := range tests { | ||
t.Run(fmt.Sprintf("given project %s/%s", tt.path, tt.repository), func(t *testing.T) { | ||
got := TrimGoPath(tt.path, tt.repository) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TrimGoPath
?, maybe a rename to TrimTemporaryPath
will be great
main.go
Outdated
tmpFolder, err := ioutil.TempDir("", "") | ||
if err != nil { | ||
log.Fatal(err) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, use os.TempDir
https://pkg.go.dev/os#TempDir
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not available for the current Go version. I had to fallback to ioutil 😞
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ioutil is deprecated: https://golang.org/doc/go1.16#ioutil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated ♻️
lib/fetch_test.go
Outdated
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestFetch(t *testing.T) { | ||
f := NewFetcher() | ||
tmpFolder, _ := ioutil.TempDir("", "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, change to os.TempDir
: https://pkg.go.dev/os#TempDir
No description provided.