aboutsummaryrefslogtreecommitdiffstats
path: root/keypair.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-01-03 19:04:00 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2019-02-05 12:59:42 +0100
commit89d2c5ed7a054bc05a21209d5a9c79ad7151f8f7 (patch)
treee19022fe717ddfb840599bf68e4c5a9268f8c278 /keypair.go
parentUpdate copyright (diff)
downloadwireguard-go-89d2c5ed7a054bc05a21209d5a9c79ad7151f8f7.tar.xz
wireguard-go-89d2c5ed7a054bc05a21209d5a9c79ad7151f8f7.zip
Extend structs rather than embed, when possible
Diffstat (limited to 'keypair.go')
-rw-r--r--keypair.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/keypair.go b/keypair.go
index bc8da0b..5530d6a 100644
--- a/keypair.go
+++ b/keypair.go
@@ -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
}