1
0
mirror of https://github.com/fumiama/tienyik.git synced 2026-06-13 04:13:15 +08:00

feat: add more apis & cmd tyaliv

This commit is contained in:
源文雨
2025-11-24 17:35:20 +08:00
parent da1de770ad
commit eaf6d29fd8
14 changed files with 990 additions and 20 deletions

View File

@@ -0,0 +1,17 @@
package textio
import (
"fmt"
"os"
"golang.org/x/term"
)
func NoEchoScanln(a ...any) (n int, err error) {
fd := int(os.Stdin.Fd())
bytePassword, err := term.ReadPassword(fd)
if err != nil {
return 0, err
}
return fmt.Sscanln(string(bytePassword)+"\n", a...)
}