build: enable unconvert linter#15456
Conversation
- fixes ethereum#15453 - update code base for failing cases
|
Hah, there's an interesting corner case (https://ci.appveyor.com/project/ethereum/go-ethereum/build/master.4274/job/sl0p87958g9ajh6q#L199). On Linux, |
karalabe
left a comment
There was a problem hiding this comment.
Figured out how to fix the Stdin issue, please take a look at the review comments.
| auths = append(auths, ssh.PasswordCallback(func() (string, error) { | ||
| fmt.Printf("What's the login password for %s at %s? (won't be echoed)\n> ", login, server) | ||
| blob, err := terminal.ReadPassword(int(syscall.Stdin)) | ||
| blob, err := terminal.ReadPassword(syscall.Stdin) |
There was a problem hiding this comment.
syscall.Stdin is problematic because it's a different type on Linux and Windows. Lets use int(os.Stdin.Fd()) here which will work on both platforms and won't cause unconvert to whine.
There was a problem hiding this comment.
Thanks, updated so.
| func (w *wizard) readPassword() string { | ||
| fmt.Printf("> ") | ||
| text, err := terminal.ReadPassword(int(syscall.Stdin)) | ||
| text, err := terminal.ReadPassword(syscall.Stdin) |
There was a problem hiding this comment.
syscall.Stdin is problematic because it's a different type on Linux and Windows. Lets use int(os.Stdin.Fd()) here which will work on both platforms and won't cause unconvert to whine.
|
@karalabe I also tried Should we wait for upstream fix or continue with your suggested fix ? |
|
I'm not sure how much work or time it would be to get IMHO the workaround is fine and int's not really ugly or anything, so it shouldn't matter. |
|
I feel same. That's why I updated. I also subscribed to |
unconvertlinter, fix detected issues #15453