Use reflect-compatible struct tags in examples

This commit is contained in:
Nate Parsons
2021-11-22 19:13:08 -08:00
committed by Alec Thomas
parent 79f896f0c0
commit f00d33b57c
3 changed files with 46 additions and 51 deletions
+1 -6
View File
@@ -18,17 +18,12 @@ import (
"github.com/alecthomas/kong"
)
type context struct {
kong *kong.Context
rl *readline.Instance
}
// Handle a single SSH interactive connection.
func handle(log *log.Logger, s ssh.Session) error {
log.Printf("New SSH")
sshPty, _, isPty := s.Pty()
if !isPty {
return errors.New("No PTY requested")
return errors.New("no PTY requested")
}
log.Printf("Using TERM=%s width=%d height=%d", sshPty.Term, sshPty.Window.Width, sshPty.Window.Height)
cpty, tty, err := pty.Open()