ects icon indicating copy to clipboard operation
ects copied to clipboard

go build -o ects main.go 失败

Open 54huige opened this issue 5 years ago • 3 comments

github.com/betterde/ects/internal/actuator

internal\actuator\shell.go:32:18: cmd.SysProcAttr.Credential undefined (type *syscall.SysProcAttr has no field or method Credential) internal\actuator\shell.go:58:39: undefined: syscall.Credential internal\actuator\shell.go:65:10: undefined: syscall.Credential

54huige avatar Dec 11 '20 02:12 54huige

是不是 windows下面 不好使?大佬在不

54huige avatar Dec 11 '20 02:12 54huige

@54huige Windows 没有兼容,这个问题有空我排查一下

jinrenjie avatar Dec 11 '20 03:12 jinrenjie

**感谢 我在网上看到 貌似 因为go版本不同导致的 我是go 1.14.4

听说改成了这样 具体是不是我也不清楚 等大佬处理了**

// cmd.SysProcAttr.Credential = &syscall.Credential{Uid: uint32(1), Gid: uint32(1)}

cmd.SysProcAttr.UidMappings = []syscall.SysProcIDMap{
{ContainerID: 5001, HostID: syscall.Getuid(), Size: 1},
}
cmd.SysProcAttr.GidMappings = []syscall.SysProcIDMap{
{ContainerID: 5001, HostID: syscall.Getgid(), Size: 1},
}

54huige avatar Dec 11 '20 03:12 54huige