Read the contents of the kite.key file.
()
| 50 | |
| 51 | // Read the contents of the kite.key file. |
| 52 | func Read() (string, error) { |
| 53 | keyPath, err := kiteKeyPath() |
| 54 | if err != nil { |
| 55 | return "", err |
| 56 | } |
| 57 | data, err := ioutil.ReadFile(keyPath) |
| 58 | if err != nil { |
| 59 | return "", err |
| 60 | } |
| 61 | return strings.TrimSpace(string(data)), nil |
| 62 | } |
| 63 | |
| 64 | // Write over the kite.key file. |
| 65 | func Write(kiteKey string) error { |