mirror of
https://github.com/Threnklyn/jira.git
synced 2026-05-19 04:33:28 +02:00
07854d6be5
github.com/tmc/keyring returns keyring.ErrNotFound instead of a blank password in newer libraries. Handle this case properly by nulling the error, to give the user a chance to set a new password.
18 lines
354 B
Go
18 lines
354 B
Go
// +build !windows
|
|
|
|
package jira
|
|
|
|
import "github.com/tmc/keyring"
|
|
|
|
func keyringGet(user string) (string, error) {
|
|
password, err := keyring.Get("go-jira", user)
|
|
if err != nil && err != keyring.ErrNotFound {
|
|
return password, err
|
|
}
|
|
return password, nil
|
|
}
|
|
|
|
func keyringSet(user, passwd string) error {
|
|
return keyring.Set("go-jira", user, passwd)
|
|
}
|