Extend structs rather than embed, when possible
This commit is contained in:
parent
dff424baf8
commit
89d2c5ed7a
16 changed files with 213 additions and 215 deletions
|
|
@ -31,15 +31,15 @@ type Keypair struct {
|
|||
}
|
||||
|
||||
type Keypairs struct {
|
||||
mutex sync.RWMutex
|
||||
sync.RWMutex
|
||||
current *Keypair
|
||||
previous *Keypair
|
||||
next *Keypair
|
||||
}
|
||||
|
||||
func (kp *Keypairs) Current() *Keypair {
|
||||
kp.mutex.RLock()
|
||||
defer kp.mutex.RUnlock()
|
||||
kp.RLock()
|
||||
defer kp.RUnlock()
|
||||
return kp.current
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue