starting 0.0.2 dev

This commit is contained in:
2025-07-30 00:49:22 +02:00
parent c099d3e64f
commit c6edb91f29
16 changed files with 287 additions and 114 deletions

View File

@@ -0,0 +1,26 @@
package credentials
import (
"bufio"
"fmt"
"os"
"strings"
"golang.org/x/term"
)
func Read() (string, string, error) {
fmt.Print("Enter username: ")
reader := bufio.NewReader(os.Stdin)
username, _ := reader.ReadString('\n')
username = strings.TrimSpace(username)
fmt.Printf("password for %s: ", username)
password, err := term.ReadPassword(int(os.Stdin.Fd()))
if err != nil {
return "", "", err
}
fmt.Println()
return username, string(password), nil
}