import log package and go fmt README example

This commit is contained in:
Yann Coleu 2016-12-03 16:08:19 +01:00 committed by GitHub
parent 1681333ee9
commit 9026f3d54a

@ -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))
}
``` ```