@@ -2,13 +2,13 @@ package keyring
22
33// ArrayKeyring is a mock/non-secure backend that meets the Keyring interface.
44// It is intended to be used to aid unit testing of code that relies on the package.
5- // NOTE: Do not use in production code
5+ // NOTE: Do not use in production code.
66type ArrayKeyring struct {
77 items map [string ]Item
88}
99
1010// NewArrayKeyring returns an ArrayKeyring, optionally constructed with an initial slice
11- // of items
11+ // of items.
1212func NewArrayKeyring (initial []Item ) * ArrayKeyring {
1313 kr := & ArrayKeyring {}
1414 for _ , i := range initial {
@@ -17,15 +17,15 @@ func NewArrayKeyring(initial []Item) *ArrayKeyring {
1717 return kr
1818}
1919
20- // Get returns an Item matching Key
20+ // Get returns an Item matching Key.
2121func (k * ArrayKeyring ) Get (key string ) (Item , error ) {
2222 if i , ok := k .items [key ]; ok {
2323 return i , nil
2424 }
2525 return Item {}, ErrKeyNotFound
2626}
2727
28- // Set will store an item on the mock Keyring
28+ // Set will store an item on the mock Keyring.
2929func (k * ArrayKeyring ) Set (i Item ) error {
3030 if k .items == nil {
3131 k .items = map [string ]Item {}
@@ -34,13 +34,13 @@ func (k *ArrayKeyring) Set(i Item) error {
3434 return nil
3535}
3636
37- // Remove will delete an Item from the Keyring
37+ // Remove will delete an Item from the Keyring.
3838func (k * ArrayKeyring ) Remove (key string ) error {
3939 delete (k .items , key )
4040 return nil
4141}
4242
43- // Keys provides a slice of all Item keys on the Keyring
43+ // Keys provides a slice of all Item keys on the Keyring.
4444func (k * ArrayKeyring ) Keys () ([]string , error ) {
4545 var keys = []string {}
4646 for key := range k .items {
0 commit comments