Skip to content

Commit

Permalink
windnsapi: Fix incorrect error checking
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Aug 19, 2024
1 parent 96bef07 commit afd8993
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
File renamed without changes.
16 changes: 16 additions & 0 deletions common/windnsapi/dnsapi_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package windnsapi

import (
"runtime"
"testing"

"github.com/stretchr/testify/require"
)

func TestDNSAPI(t *testing.T) {
if runtime.GOOS != "windows" {
t.SkipNow()
}
t.Parallel()
require.NoError(t, FlushResolverCache())
}
2 changes: 1 addition & 1 deletion common/windnsapi/syscall_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ package windnsapi
//go:generate go run golang.org/x/sys/windows/mkwinsyscall -output zsyscall_windows.go syscall_windows.go

// dnsapi.DnsFlushResolverCache is an undocumented function
//sys FlushResolverCache() (ret error) = dnsapi.DnsFlushResolverCache
//sys FlushResolverCache() (err error) = dnsapi.DnsFlushResolverCache
8 changes: 4 additions & 4 deletions common/windnsapi/zsyscall_windows.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit afd8993

Please sign in to comment.