diff options
author | Bas van Kervel <basvankervel@ziggo.nl> | 2015-05-12 20:24:11 +0800 |
---|---|---|
committer | Bas van Kervel <basvankervel@ziggo.nl> | 2015-05-12 20:24:11 +0800 |
commit | b79dd188d916da7adbf448dc27b0c59a04e0938d (patch) | |
tree | 7980ae848a916171fbc65fb958eebdf0c98406dc /crypto/key_store_plain.go | |
parent | d82caa5ce38705d2dcdc2ba15c93df9325504e34 (diff) | |
download | go-tangerine-b79dd188d916da7adbf448dc27b0c59a04e0938d.tar.gz go-tangerine-b79dd188d916da7adbf448dc27b0c59a04e0938d.tar.zst go-tangerine-b79dd188d916da7adbf448dc27b0c59a04e0938d.zip |
replaced several path.* with filepath.* which is platform independent
Diffstat (limited to 'crypto/key_store_plain.go')
-rw-r--r-- | crypto/key_store_plain.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crypto/key_store_plain.go b/crypto/key_store_plain.go index 9bbaf1c15..581968d7c 100644 --- a/crypto/key_store_plain.go +++ b/crypto/key_store_plain.go @@ -30,7 +30,7 @@ import ( "io" "io/ioutil" "os" - "path" + "path/filepath" ) // TODO: rename to KeyStore when replacing existing KeyStore @@ -91,20 +91,20 @@ func (ks keyStorePlain) StoreKey(key *Key, auth string) (err error) { } func (ks keyStorePlain) DeleteKey(keyAddr []byte, auth string) (err error) { - keyDirPath := path.Join(ks.keysDirPath, hex.EncodeToString(keyAddr)) + keyDirPath := filepath.Join(ks.keysDirPath, hex.EncodeToString(keyAddr)) err = os.RemoveAll(keyDirPath) return err } func GetKeyFile(keysDirPath string, keyAddr []byte) (fileContent []byte, err error) { fileName := hex.EncodeToString(keyAddr) - return ioutil.ReadFile(path.Join(keysDirPath, fileName, fileName)) + return ioutil.ReadFile(filepath.Join(keysDirPath, fileName, fileName)) } func WriteKeyFile(addr []byte, keysDirPath string, content []byte) (err error) { addrHex := hex.EncodeToString(addr) - keyDirPath := path.Join(keysDirPath, addrHex) - keyFilePath := path.Join(keyDirPath, addrHex) + keyDirPath := filepath.Join(keysDirPath, addrHex) + keyFilePath := filepath.Join(keyDirPath, addrHex) err = os.MkdirAll(keyDirPath, 0700) // read, write and dir search for user if err != nil { return err |