Skip to content

Commit

Permalink
Fix: make golangci lint support multi GOOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamacro committed Apr 13, 2022
1 parent b3d7594 commit c282d66
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,11 @@ all-arch: $(PLATFORM_LIST) $(WINDOWS_ARCH_LIST)
releases: $(gz_releases) $(zip_releases)

lint:
golangci-lint run ./...
GOOS=darwin golangci-lint run ./...
GOOS=windows golangci-lint run ./...
GOOS=linux golangci-lint run ./...
GOOS=freebsd golangci-lint run ./...
GOOS=openbsd golangci-lint run ./...

clean:
rm $(BINDIR)/*
4 changes: 2 additions & 2 deletions component/process/process_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func newSearcher(isV4, isTCP bool) *searcher {
func getTransportTable(fn uintptr, family int, class int) ([]byte, error) {
for size, buf := uint32(8), make([]byte, 8); ; {
ptr := unsafe.Pointer(&buf[0])
err, _, _ := syscall.Syscall6(fn, 6, uintptr(ptr), uintptr(unsafe.Pointer(&size)), 0, uintptr(family), uintptr(class), 0)
err, _, _ := syscall.SyscallN(fn, 6, uintptr(ptr), uintptr(unsafe.Pointer(&size)), 0, uintptr(family), uintptr(class), 0)

switch err {
case 0:
Expand Down Expand Up @@ -209,7 +209,7 @@ func getExecPathFromPID(pid uint32) (string, error) {

buf := make([]uint16, syscall.MAX_LONG_PATH)
size := uint32(len(buf))
r1, _, err := syscall.Syscall6(
r1, _, err := syscall.SyscallN(
queryProcName, 4,
uintptr(h),
uintptr(1),
Expand Down

0 comments on commit c282d66

Please sign in to comment.