Skip to content

Commit

Permalink
fix: newTempFile will return tempFile.Name() as filePath
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexilee committed Oct 7, 2018
1 parent 34636bf commit 771dc49
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions benchmark_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package gotten_test

import "testing"

func buildRequestBySelf() {}

func BenchmarkCreateRequest(b *testing.B) {

}
2 changes: 1 addition & 1 deletion unmarshalers/FileCtr.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func getSizeAndHash(reader io.Reader) (size int64, hash string, err error) {
func newTempFile() (tempFile *os.File, filePath string, err error) {
tempFile, err = ioutil.TempFile(ZeroStr, TempFilePattern)
if err == nil {
filePath = filepath.Join(os.TempDir(), tempFile.Name())
filePath = tempFile.Name()
}
return
}

0 comments on commit 771dc49

Please sign in to comment.