reiver / go-telnet

Package telnet provides TELNET and TELNETS client and server implementations, for the Go programming language, in a style similar to the "net/http" library that is part of the Go standard library, including support for "middleware"; TELNETS is secure TELNET, with the TELNET protocol over a secured TLS (or SSL) connection.
https://godoc.org/github.com/reiver/go-telnet
MIT License
266 stars 83 forks source link

TELNET Shell Server Example build error #2

Closed CodyGuo closed 6 years ago

CodyGuo commented 7 years ago

.\main.go:8: imported and not used: "fmt" .\main.go:19: undefined: telsh.Context .\main.go:20: cannot use fiveHandler (type func(io.ReadCloser, io.WriteCloser, io.WriteCloser) error) as type telsh.HandlerFunc in argument to telsh.PromoteHandlerFunc .\main.go:60: undefined: telsh.Context .\main.go:62: cannot use danceHandler (type func(io.ReadCloser, io.WriteCloser, io.WriteCloser) error) as type telsh.HandlerFunc in argument to telsh.PromoteHandlerFunc .\main.go:81: cannot convert fiveProducer (type func(, string, ...string) telsh.Handler) to type telsh.ProducerFunc .\main.go:87: cannot convert danceProducer (type func(, string, ...string) telsh.Handler) to type telsh.ProducerFunc .\main.go:91: cannot convert danceProducer (type func(, string, ...string) telsh.Handler) to type telsh.ProducerFunc

creasyimm commented 7 years ago

same error

poojakar commented 7 years ago

Can anyone suggest me how to send command 'status' with telnet in go client?

MikhailMS commented 7 years ago

In case someone still interested in how to run the Shell Server example:

  1. change Handler functions to match signature (stdin io.ReadCloser, stdout io.WriteCloser, stderr io.WriteCloser, args ...string)
  2. change Producer functions to match signature (ctx telnet.Context, name string, args ...string)
Newbetek commented 6 years ago

Since such a simple fix in the instructions on how to use the package has not been fixed in a year and a half, I'm thinking that this package has been abandoned?

reiver commented 6 years ago

@Newbetek No, it hasn't been abandoned.

I got busy building a bank for the last 3 years.

(I've never built a bank before. It is very interesting.)

Thanks for commenting. It made me look at this package again.

I'll take a look.

reiver commented 6 years ago

@CodyGuo @creasyimm @poojakar @MikhailMS @Newbetek

I updated the docs.

If you have time, please check to see that the code (that you cared about) in the docs works now.

I'm going to close this issue.

If you find there are still problems, please open a new issue.

(BTW... if you notice I am unresponsive here, you can always ping me on Twitter. My username there is the same as my GitHub userna.e)