-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
x/crypto/ssh/terminal: cannot use syscall.Stdin (type syscall.Handle) as type int in argument to terminal.IsTerminal #12978
Comments
I don't think the x/crypto/ssh/terminal package supports Windows. This isn't a bug in Go, but a lack of implementation in an external package. |
Nevermind, the x/crypto/ssh/terminal package does support Windows and build.golang.org says it's passing its tests. I see the code for Windows in x/crypto/ssh/terminal and I can install it fine:
Your error message contains I think you have the wrong bug tracker. I don't know what package you're compiling, but it's not in the Go repos anywhere. |
@bradfitz are you sure there are tests for this part? |
This is the package https://github.com/lxc/lxd/blob/master/lxc/config.go#L98
It works on Linux, but fails on Windows. There is no system dependent code in this part of my code. It is solely on Go side. |
Yes, there are tests. And build.golang.org shows that it's passing. The code in github.com/lxc/lxd is wrong. The error messages (they're not warnings; Go doesn't have warnings) you pasted above are the reason. I can't explain it any more clearly than the error messages already say. |
It doesn't even seem to compile on Linux!
In any case, all you should have to do is change it to: if !terminal.IsTerminal(int(syscall.Stdin)) && value == "-" { |
It can't be that it don't compile - test are green - https://github.com/lxc/lxd#ci-status Although I can't find where |
@bradfitz it is strange that syscall.Stdin changes type on Windows. I expected types to be platform-independent, but thanks for this hint. |
In any case, this is the wrong bug tracker. |
@bradfitz it is at least documentation bug in golang. According to https://golang.org/pkg/syscall/#pkg-variables syscall.Stdin should be int on all platforms. And for system-specific Windows calls, it could be made with syscall.StdinHandler or something. |
@techtonik, golang.org/pkg displays documentation for Linux. Actually the additional documentation that you request is already there:
|
@kostya-sh thanks for clarification. Created issue. ;) |
This warnings are Windows only:
And the code in
lxc\config.go:99
is this:How to fix that? Is it a Go bug?
The text was updated successfully, but these errors were encountered: