import log package and go fmt README example
This commit is contained in:
parent
1681333ee9
commit
9026f3d54a
29
README.md
29
README.md
@ -8,20 +8,21 @@ building SSH servers. The goal of the API was to make it as simple as using
|
|||||||
[net/http](https://golang.org/pkg/net/http/), so the API is very similar:
|
[net/http](https://golang.org/pkg/net/http/), so the API is very similar:
|
||||||
|
|
||||||
```
|
```
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io"
|
"github.com/gliderlabs/ssh"
|
||||||
"github.com/gliderlabs/ssh"
|
"io"
|
||||||
)
|
"log"
|
||||||
|
)
|
||||||
func main() {
|
|
||||||
ssh.Handle(func(s ssh.Session) {
|
func main() {
|
||||||
io.WriteString(s, "Hello world\n")
|
ssh.Handle(func(s ssh.Session) {
|
||||||
})
|
io.WriteString(s, "Hello world\n")
|
||||||
|
})
|
||||||
log.Fatal(ssh.ListenAndServe(":2222", nil))
|
|
||||||
}
|
log.Fatal(ssh.ListenAndServe(":2222", nil))
|
||||||
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user