device: allow compiling with Go 1.15

Until we depend on Go 1.16 (which isn't released yet), alias our own
variable to the private member of the net package. This will allow an
easy find replace to make this go away when we eventually switch to
1.16.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld
2021-01-20 20:04:31 +01:00
parent 86a58b51c0
commit 294d3bedf9
4 changed files with 19 additions and 6 deletions

13
conn/net_err_closed.go Normal file
View File

@@ -0,0 +1,13 @@
/* SPDX-License-Identifier: MIT
*
* Copyright (C) 2021 WireGuard LLC. All Rights Reserved.
*/
package conn
import _ "unsafe"
//TODO: replace this with net.ErrClosed for Go 1.16
//go:linkname NetErrClosed internal/poll.ErrNetClosing
var NetErrClosed error