kaspad/cmd/kaspawallet/utils/readline.go
Svarog 16ba2bd312
Export DefaultPath + Add logging to kaspawallet daemon (#1730)
* Export DefaultPath + Add logging to kaspawallet daemon

* Export purpose and CoinType instead of defaultPath

* Move TODO to correct place
2021-05-26 18:51:11 +03:00

19 lines
342 B
Go

package utils
import (
"bufio"
"strings"
"github.com/pkg/errors"
)
// ReadLine reads one line from the given reader with trimmed white space.
func ReadLine(reader *bufio.Reader) (string, error) {
line, err := reader.ReadBytes('\n')
if err != nil {
return "", errors.WithStack(err)
}
return strings.TrimSpace(string(line)), nil
}