1
0
mirror of https://git.zx2c4.com/wireguard-go synced 2024-11-15 01:05:15 +01:00
wireguard-go/device
Matt Layher 18b6627f33 device, ratelimiter: replace uses of time.Now().Sub() with time.Since()
Simplification found by staticcheck:

$ staticcheck ./... | grep S1012
device/cookie.go:90:5: should use time.Since instead of time.Now().Sub (S1012)
device/cookie.go:127:5: should use time.Since instead of time.Now().Sub (S1012)
device/cookie.go:242:5: should use time.Since instead of time.Now().Sub (S1012)
device/noise-protocol.go:304:13: should use time.Since instead of time.Now().Sub (S1012)
device/receive.go:82:46: should use time.Since instead of time.Now().Sub (S1012)
device/send.go:132:5: should use time.Since instead of time.Now().Sub (S1012)
device/send.go:139:5: should use time.Since instead of time.Now().Sub (S1012)
device/send.go:235:59: should use time.Since instead of time.Now().Sub (S1012)
device/send.go:393:9: should use time.Since instead of time.Now().Sub (S1012)
ratelimiter/ratelimiter.go:79:10: should use time.Since instead of time.Now().Sub (S1012)
ratelimiter/ratelimiter.go:87:10: should use time.Since instead of time.Now().Sub (S1012)

Change applied using:

$ find . -type f -name "*.go" -exec sed -i "s/Now().Sub(/Since(/g" {} \;

Signed-off-by: Matt Layher <mdlayher@gmail.com>
2019-06-03 22:15:41 +02:00
..
allowedips_rand_test.go global: begin modularization 2019-03-03 05:00:40 +01:00
allowedips_test.go global: begin modularization 2019-03-03 05:00:40 +01:00
allowedips.go global: begin modularization 2019-03-03 05:00:40 +01:00
bind_test.go global: begin modularization 2019-03-03 05:00:40 +01:00
boundif_android.go device: fail to give bind if it doesn't exist 2019-05-17 15:35:20 +02:00
boundif_windows.go global: regroup all imports 2019-05-14 09:09:52 +02:00
conn_default.go boundif: introduce API for socket binding 2019-03-04 16:37:11 +01:00
conn_linux.go global: regroup all imports 2019-05-14 09:09:52 +02:00
conn.go global: regroup all imports 2019-05-14 09:09:52 +02:00
constants.go device: make initiations per second match kernel implementation 2019-05-25 02:07:18 +02:00
cookie_test.go global: begin modularization 2019-03-03 05:00:40 +01:00
cookie.go device, ratelimiter: replace uses of time.Now().Sub() with time.Since() 2019-06-03 22:15:41 +02:00
device_test.go device, tun: rearrange code and fix device tests 2019-05-29 18:34:55 +02:00
device.go device: add SendKeepalivesToPeersWithCurrentKeypair for handover 2019-05-30 15:16:16 +02:00
endpoint_test.go global: begin modularization 2019-03-03 05:00:40 +01:00
indextable.go global: begin modularization 2019-03-03 05:00:40 +01:00
ip.go global: begin modularization 2019-03-03 05:00:40 +01:00
kdf_test.go global: regroup all imports 2019-05-14 09:09:52 +02:00
keypair.go global: regroup all imports 2019-05-14 09:09:52 +02:00
logger.go global: begin modularization 2019-03-03 05:00:40 +01:00
mark_default.go boundif: introduce API for socket binding 2019-03-04 16:37:11 +01:00
mark_unix.go global: regroup all imports 2019-05-14 09:09:52 +02:00
misc.go global: begin modularization 2019-03-03 05:00:40 +01:00
noise_test.go global: begin modularization 2019-03-03 05:00:40 +01:00
noise-helpers.go global: regroup all imports 2019-05-14 09:09:52 +02:00
noise-protocol.go device, ratelimiter: replace uses of time.Now().Sub() with time.Since() 2019-06-03 22:15:41 +02:00
noise-types.go global: regroup all imports 2019-05-14 09:09:52 +02:00
peer.go boundif: introduce API for socket binding 2019-03-04 16:37:11 +01:00
pools.go global: begin modularization 2019-03-03 05:00:40 +01:00
queueconstants_android.go receive: implement flush semantics 2019-03-21 14:45:41 -06:00
queueconstants_default.go tun: import mobile particularities 2019-03-04 16:37:11 +01:00
queueconstants_ios.go tun: import mobile particularities 2019-03-04 16:37:11 +01:00
receive.go device, ratelimiter: replace uses of time.Now().Sub() with time.Since() 2019-06-03 22:15:41 +02:00
send.go device, ratelimiter: replace uses of time.Now().Sub() with time.Since() 2019-06-03 22:15:41 +02:00
timers.go device: timers: add jitter on ack failure reinitiation 2019-05-24 13:48:25 +02:00
tun_test.go device, tun: rearrange code and fix device tests 2019-05-29 18:34:55 +02:00
tun.go global: regroup all imports 2019-05-14 09:09:52 +02:00
uapi.go global: regroup all imports 2019-05-14 09:09:52 +02:00
version.go version: bump snapshot 2019-05-17 10:28:04 +02:00