Skip to content
This repository was archived by the owner on Jun 2, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions prompt.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
package prompt

import "github.com/howeyc/gopass"
import (
"os"

"github.com/howeyc/gopass"
)

import "strings"
import "strconv"
import "fmt"
import "bufio"

// String prompt.
func String(prompt string, args ...interface{}) string {
var s string
fmt.Printf(prompt+": ", args...)
fmt.Scanln(&s)
return s
reader := bufio.NewReader(os.Stdin)
bytes, _, _ := reader.ReadLine()
return string(bytes)
}

// String prompt (required).
Expand Down