diff --git a/cmd/faucet/faucet.go b/cmd/faucet/faucet.go index 0b0f90eafa..63a610baf9 100644 --- a/cmd/faucet/faucet.go +++ b/cmd/faucet/faucet.go @@ -157,8 +157,8 @@ func main() { if blob, err = ioutil.ReadFile(*accPassFlag); err != nil { log.Crit("Failed to read account password contents", "file", *accPassFlag, "err", err) } - // delete "\n" of a line which get from ioutil.ReadFile - pass := strings.Replace(string(blob), "\n", "", -1) + // Delete trailing newline in password + pass := strings.TrimSufix(string(blob), "\n") ks := keystore.NewKeyStore(filepath.Join(os.Getenv("HOME"), ".faucet", "keys"), keystore.StandardScryptN, keystore.StandardScryptP) if blob, err = ioutil.ReadFile(*accJSONFlag); err != nil {