minor fix while doing docs

This commit is contained in:
Boshi Lian 2022-07-05 20:31:14 +00:00
parent e1aa1c9823
commit 5e0572a43f
7 changed files with 43 additions and 30 deletions

View file

@ -18,14 +18,14 @@ func main() {
CreateConfig: func(_ *cli.Context) (*libplugin.SshPiperPluginConfig, error) {
return &libplugin.SshPiperPluginConfig{
KeyboardInteractiveCallback: func(conn libplugin.ConnMetadata, client libplugin.KeyboardInteractiveChallenge) (*libplugin.Upstream, error) {
client("lets do math", "", false)
client("", "lets do math", "", false)
for {
a := rand.Intn(10)
b := rand.Intn(10)
ans, err := client("", fmt.Sprintf("what is %v + %v = ", a, b), true)
ans, err := client("", "", fmt.Sprintf("what is %v + %v = ", a, b), true)
if err != nil {
return nil, err
}
@ -33,6 +33,9 @@ func main() {
log.Printf("got ans = %v", ans)
if ans == fmt.Sprintf("%v", a+b) {
log.Printf("got ans = %v", ans)
return &libplugin.Upstream{
Auth: libplugin.CreateNextPluginAuth(map[string]string{
"a": strconv.Itoa(a),