Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not enough arguments in call to syscall.Syscall #44

Open
ccpwcn opened this issue Jun 18, 2024 · 0 comments
Open

not enough arguments in call to syscall.Syscall #44

ccpwcn opened this issue Jun 18, 2024 · 0 comments

Comments

@ccpwcn
Copy link

ccpwcn commented Jun 18, 2024

  • Win10 x64
  • Go 1.22.4

create an empty project, only one main.go, code from readme.md

package main

import (
	"encoding/json"
	"fmt"
	"log"
	"os/user"

	"github.com/zcalusic/sysinfo"
)

func main() {
	current, err := user.Current()
	if err != nil {
		log.Fatal(err)
	}

	if current.Uid != "0" {
		log.Fatal("requires superuser privilege")
	}

	var si sysinfo.SysInfo

	si.GetSysInfo()

	data, err := json.MarshalIndent(&si, "", "  ")
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(string(data))
}

run build command

go build -o sys_info.exe .\main.go

failed:

PS E:\code\GoglandProjects\sys_info> go build -o sys_info.exe .\main.go
# github.com/zcalusic/sysinfo
C:\Users\Administrator\go\pkg\mod\github.com\zcalusic\[email protected]\sysinfo.go:13:10: undefined: Kernel
C:\Users\Administrator\go\pkg\mod\github.com\zcalusic\[email protected]\sysinfo.go:48:5: si.getKernelInfo undefined (type *SysInfo has no field or method getKernelInfo)
C:\Users\Administrator\go\pkg\mod\github.com\zcalusic\[email protected]\network.go:104:41: undefined: syscall.SYS_IOCTL
C:\Users\Administrator\go\pkg\mod\github.com\zcalusic\[email protected]\network.go:104:87: not enough arguments in call to syscall.Syscall
        have (unknown type, uintptr, uintptr, uintptr)
        want (uintptr, uintptr, uintptr, uintptr, uintptr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant