Mercurial > go > multipass
comparison multipass-checkpassword.go @ 6:10613f0f4737
Read from fd3, not stdin.
| author | Paul Fisher <paul@pfish.zone> |
|---|---|
| date | Sat, 24 Oct 2015 23:33:16 -0400 |
| parents | 882f913f4e89 |
| children | 4db389f948c9 |
comparison
equal
deleted
inserted
replaced
| 5:882f913f4e89 | 6:10613f0f4737 |
|---|---|
| 14 Failed = 1 | 14 Failed = 1 |
| 15 ) | 15 ) |
| 16 | 16 |
| 17 func main() { | 17 func main() { |
| 18 infile := os.NewFile(3, "") | 18 infile := os.NewFile(3, "") |
| 19 reader := bufio.NewReader(os.Stdin) | 19 reader := bufio.NewReader(infile) |
| 20 username, err := reader.ReadString(0) | 20 username, err := reader.ReadString(0) |
| 21 if err != nil { | 21 if err != nil { |
| 22 os.Exit(InternalError) | 22 os.Exit(InternalError) |
| 23 } | 23 } |
| 24 username = username[:len(username)-1] | 24 username = username[:len(username)-1] |
