Skip to content

Commit

Permalink
Fix issues identified by golint
Browse files Browse the repository at this point in the history
  • Loading branch information
mtibben committed May 17, 2019
1 parent 4546b61 commit 034fea6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions config.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package keyring

// Config contains configuration for keyring
type Config struct {
// AllowedBackends is a whitelist of backend providers that can be used. Nil means all available.
AllowedBackends []BackendType
Expand Down
4 changes: 2 additions & 2 deletions keychain.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,10 @@ func (k *keychain) createOrOpen() (gokeychain.Keychain, error) {
if err == nil {
debugf("Keychain status returned nil, keychain exists")
return kc, nil
} else {
debugf("Keychain status returned error: %v", err)
}

debugf("Keychain status returned error: %v", err)

if err != gokeychain.ErrorNoSuchKeychain {
return gokeychain.Keychain{}, err
}
Expand Down
9 changes: 5 additions & 4 deletions keyring.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import (
"log"
)

// A BackendType is an identifier for a credential storage service
type BackendType string

// All currently supported secure storage backends
const (
InvalidBackend BackendType = "invalid"
Expand All @@ -34,8 +37,6 @@ var backendOrder = []BackendType{
FileBackend,
}

type BackendType string

var supportedBackends = map[BackendType]opener{}

// AvailableBackends provides a slice of all available backend keys on the current OS
Expand Down Expand Up @@ -99,10 +100,10 @@ type Keyring interface {
var ErrNoAvailImpl = errors.New("Specified keyring backend not available")

// ErrKeyNotFound is returned by Keyring Get when the item is not on the keyring
var ErrKeyNotFound = errors.New("The specified item could not be found in the keyring.")
var ErrKeyNotFound = errors.New("The specified item could not be found in the keyring")

var (
// Whether to print debugging output
// Debug specifies whether to print debugging output
Debug bool
)

Expand Down
1 change: 1 addition & 0 deletions prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"golang.org/x/crypto/ssh/terminal"
)

// PromptFunc is a function used to prompt the user for a password
type PromptFunc func(string) (string, error)

func terminalPrompt(prompt string) (string, error) {
Expand Down

0 comments on commit 034fea6

Please sign in to comment.