go - 尝试在 GO 中安装 StackImpact 库时出错

标签 go

尝试在 GO 中安装 StackImpact 时出现以下错误。有谁知道如何修复它?

谢谢..

Microsoft Windows [versão 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Todos os direitos reservados.
C:\Users\leonardo>go get github.com/stackimpact/stackimpact-go
# github.com/stackimpact/stackimpact-go/internal
C:\gowork\src\github.com\stackimpact\stackimpact-go\internal\process_reporter.go
:96: undefined: syscall.Getrusage
C:\gowork\src\github.com\stackimpact\stackimpact-go\internal\process_reporter.go
:102: rusage.Utime undefined (type *syscall.Rusage has no field or method Utime)
C:\gowork\src\github.com\stackimpact\stackimpact-go\internal\process_reporter.go
:103: rusage.Utime undefined (type *syscall.Rusage has no field or method Utime)
C:\gowork\src\github.com\stackimpact\stackimpact-go\internal\process_reporter.go
:104: rusage.Stime undefined (type *syscall.Rusage has no field or method Stime)
C:\gowork\src\github.com\stackimpact\stackimpact-go\internal\process_reporter.go
:105: rusage.Stime undefined (type *syscall.Rusage has no field or method Stime)
C:\gowork\src\github.com\stackimpact\stackimpact-go\internal\process_reporter.go
:112: undefined: syscall.Getrusage
C:\gowork\src\github.com\stackimpact\stackimpact-go\internal\process_reporter.go
:117: rusage.Maxrss undefined (type *syscall.Rusage has no field or method Maxrs
s)
C:\Users\leonardo>

最佳答案

您正在尝试编译适用于 Windows 中的 Linux 的代码。 syscall.Getrusage 是一个 linux 系统调用。

https://golang.org/src/syscall/zsyscall_linux_amd64.go?s=13296:13347#L546

关于go - 尝试在 GO 中安装 StackImpact 库时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41404011/

相关文章:

arrays - 将位串转换为字节数组

奇怪的行为 - 变量没有正确递增

multithreading - 是否应该在长时间运行的进程中留下空闲线程?

type-conversion - 如何在 Go 中将 [4]uint8 转换为 uint32?

file - 在 Go 中将多个结构写入一个文件

go - 为什么重新定义变量并不总是触发错误?

go - 如何通过变量将任意 JSON 映射传递给自定义类型

json - 有效地从 JSON 文件中删除无效字符?

regex - 查找不在另一个文本字符串中的文本?

如果使用字段中具有默认值的 Struct 实例进行过滤,Go-gorm 将返回所有记录