aboutsummaryrefslogtreecommitdiff
path: root/tun/wintun/dll_windows.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-11-07 21:56:32 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2020-11-07 21:56:32 +0100
commit82128c47d90a54faded017ad3e5bc61eb0c641db (patch)
tree91ec906e69ba373f1ef014dd1ce684cb459d44c8 /tun/wintun/dll_windows.go
parentc192b2eeec5dc8e21e8a6deb5e6dcceda91d649c (diff)
downloadwireguard-go-82128c47d90a54faded017ad3e5bc61eb0c641db.tar.gz
wireguard-go-82128c47d90a54faded017ad3e5bc61eb0c641db.zip
global: switch to using %w instead of %v for Errorf
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'tun/wintun/dll_windows.go')
-rw-r--r--tun/wintun/dll_windows.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/tun/wintun/dll_windows.go b/tun/wintun/dll_windows.go
index af1e016..4a55e97 100644
--- a/tun/wintun/dll_windows.go
+++ b/tun/wintun/dll_windows.go
@@ -39,15 +39,15 @@ func (d *lazyDLL) Load() error {
const ourModule windows.Handle = 0
resInfo, err := resource.FindByName(ourModule, d.Name, resource.RT_RCDATA)
if err != nil {
- return fmt.Errorf("Unable to find \"%v\" RCDATA resource: %v", d.Name, err)
+ return fmt.Errorf("Unable to find \"%v\" RCDATA resource: %w", d.Name, err)
}
data, err := resource.Load(ourModule, resInfo)
if err != nil {
- return fmt.Errorf("Unable to load resource: %v", err)
+ return fmt.Errorf("Unable to load resource: %w", err)
}
module, err := memmod.LoadLibrary(data)
if err != nil {
- return fmt.Errorf("Unable to load library: %v", err)
+ return fmt.Errorf("Unable to load library: %w", err)
}
atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(&d.module)), unsafe.Pointer(module))
@@ -77,11 +77,11 @@ func (p *lazyProc) Find() error {
err := p.dll.Load()
if err != nil {
- return fmt.Errorf("Error loading %v DLL: %v", p.dll.Name, err)
+ return fmt.Errorf("Error loading %v DLL: %w", p.dll.Name, err)
}
addr, err := p.dll.module.ProcAddressByName(p.Name)
if err != nil {
- return fmt.Errorf("Error getting %v address: %v", p.Name, err)
+ return fmt.Errorf("Error getting %v address: %w", p.Name, err)
}
atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(&p.addr)), unsafe.Pointer(addr))