mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-31 23:16:54 +00:00
Fix Docker os.Rename invalid cross-device link issue (#386)
* Adds new file.Move func to address a bug with Golang/Docker volumes when using os.Rename Also uses TempDir for tests instead of live directories and increases test coverage for file.Write * Goimport the imports * Make usage of file package name consistent so it no longer clashes with vars * Remove outputFile if io.Copy fails
This commit is contained in:
@@ -18,6 +18,7 @@ import (
|
||||
|
||||
"github.com/pquerna/otp/totp"
|
||||
"github.com/thrasher-corp/gocryptotrader/common"
|
||||
"github.com/thrasher-corp/gocryptotrader/common/file"
|
||||
"github.com/thrasher-corp/gocryptotrader/currency"
|
||||
"github.com/thrasher-corp/gocryptotrader/dispatch"
|
||||
exchange "github.com/thrasher-corp/gocryptotrader/exchanges"
|
||||
@@ -867,12 +868,12 @@ func genCert(targetDir string) error {
|
||||
return fmt.Errorf("key pem data is nil")
|
||||
}
|
||||
|
||||
err = common.WriteFile(filepath.Join(targetDir, "key.pem"), keyData)
|
||||
err = file.Write(filepath.Join(targetDir, "key.pem"), keyData)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to write key.pem file %s", err)
|
||||
}
|
||||
|
||||
err = common.WriteFile(filepath.Join(targetDir, "cert.pem"), certData)
|
||||
err = file.Write(filepath.Join(targetDir, "cert.pem"), certData)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to write cert.pem file %s", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user