aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authoradnano <[email protected]>2020-10-11 21:55:30 -0400
committeradnano <[email protected]>2020-10-11 21:55:30 -0400
commit3b5cc23d284512cfad768a67b5962dd8e302b0c1 (patch)
tree272cc5f0b884961bf2a24c6a9b9828baea418c14 /examples
parentDetect mimetypes (diff)
downloadgo-gemini-3b5cc23d284512cfad768a67b5962dd8e302b0c1.tar.xz
go-gemini-3b5cc23d284512cfad768a67b5962dd8e302b0c1.zip
Remove dependency on golang.org/x/crypto
Diffstat (limited to 'examples')
-rw-r--r--examples/client/client.go14
1 files changed, 2 insertions, 12 deletions
diff --git a/examples/client/client.go b/examples/client/client.go
index 534c5a3..4d61868 100644
--- a/examples/client/client.go
+++ b/examples/client/client.go
@@ -8,11 +8,9 @@ import (
"crypto/x509"
"fmt"
"os"
- "syscall"
"time"
"git.sr.ht/~adnano/gmi"
- "golang.org/x/crypto/ssh/terminal"
)
var (
@@ -77,16 +75,8 @@ func sendRequest(req *gmi.Request) error {
switch resp.Status / 10 {
case gmi.StatusClassInput:
fmt.Printf("%s: ", resp.Meta)
- if resp.Status == gmi.StatusSensitiveInput {
- input, err := terminal.ReadPassword(int(syscall.Stdin))
- if err != nil {
- return err
- }
- req.URL.RawQuery = string(input)
- } else {
- scanner.Scan()
- req.URL.RawQuery = scanner.Text()
- }
+ scanner.Scan()
+ req.URL.RawQuery = scanner.Text()
return sendRequest(req)
case gmi.StatusClassSuccess:
fmt.Print(string(resp.Body))