aboutsummaryrefslogtreecommitdiffstats
path: root/device/uapi.go
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josh@tailscale.com>2022-03-16 16:40:24 -0700
committerJosh Bleecher Snyder <josh@tailscale.com>2022-03-16 16:40:24 -0700
commit46826fc4e5dcfb472f7ae0c13d2ca65110441f0b (patch)
treead3f1463e0e6a44a7245542da5f6c734c0dfb968 /device/uapi.go
parentall: update to Go 1.18 (diff)
downloadwireguard-go-46826fc4e5dcfb472f7ae0c13d2ca65110441f0b.tar.xz
wireguard-go-46826fc4e5dcfb472f7ae0c13d2ca65110441f0b.zip
all: use any in place of interface{}
Enabled by using Go 1.18. A bit less verbose. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
Diffstat (limited to '')
-rw-r--r--device/uapi.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/device/uapi.go b/device/uapi.go
index 746cf29..30dd97e 100644
--- a/device/uapi.go
+++ b/device/uapi.go
@@ -39,12 +39,12 @@ func (s IPCError) ErrorCode() int64 {
return s.code
}
-func ipcErrorf(code int64, msg string, args ...interface{}) *IPCError {
+func ipcErrorf(code int64, msg string, args ...any) *IPCError {
return &IPCError{code: code, err: fmt.Errorf(msg, args...)}
}
var byteBufferPool = &sync.Pool{
- New: func() interface{} { return new(bytes.Buffer) },
+ New: func() any { return new(bytes.Buffer) },
}
// IpcGetOperation implements the WireGuard configuration protocol "get" operation.
@@ -56,7 +56,7 @@ func (device *Device) IpcGetOperation(w io.Writer) error {
buf := byteBufferPool.Get().(*bytes.Buffer)
buf.Reset()
defer byteBufferPool.Put(buf)
- sendf := func(format string, args ...interface{}) {
+ sendf := func(format string, args ...any) {
fmt.Fprintf(buf, format, args...)
buf.WriteByte('\n')
}