Browse Source

remove some assertXxx funcs

pull/1782/head
Ethan Buchman 7 years ago
parent
commit
1775be1cd9
3 changed files with 3 additions and 20 deletions
  1. +1
    -10
      keys/cryptostore/holder.go
  2. +1
    -5
      keys/storage/filestorage/main.go
  3. +1
    -5
      keys/storage/memstorage/main.go

+ 1
- 10
keys/cryptostore/holder.go View File

@ -24,19 +24,10 @@ func New(coder Encoder, store keys.Storage, codec keys.Codec) Manager {
}
}
// assert Manager satisfies keys.Signer and keys.Manager interfaces
var _ keys.Signer = Manager{}
var _ keys.Manager = Manager{}
// exists just to make sure we fulfill the Signer interface
func (s Manager) assertSigner() keys.Signer {
return s
}
// exists just to make sure we fulfill the Manager interface
func (s Manager) assertKeyManager() keys.Manager {
return s
}
// Create adds a new key to the storage engine, returning error if
// another key already stored under this name
//


+ 1
- 5
keys/storage/filestorage/main.go View File

@ -42,13 +42,9 @@ func New(dir string) FileStore {
return FileStore{dir}
}
// assert FileStore satisfies keys.Storage
var _ keys.Storage = FileStore{}
// assertStorage just makes sure we implement the proper Storage interface
func (s FileStore) assertStorage() keys.Storage {
return s
}
// Put creates two files, one with the public info as json, the other
// with the (encoded) private key as gpg ascii-armor style
func (s FileStore) Put(name string, key []byte, info keys.Info) error {


+ 1
- 5
keys/storage/memstorage/main.go View File

@ -22,13 +22,9 @@ func New() MemStore {
return MemStore{}
}
// assert MemStore satisfies keys.Storage
var _ keys.Storage = MemStore{}
// assertStorage just makes sure we implement the Storage interface
func (s MemStore) assertStorage() keys.Storage {
return s
}
// Put adds the given key, returns an error if it another key
// is already stored under this name
func (s MemStore) Put(name string, key []byte, info keys.Info) error {


Loading…
Cancel
Save