projects/sievemgr

changeset 11:29769b9e2f09

Switch to golang.org/x/term module

Switch from golang.org/x/crypto/ssh/terminal to the new golang.org/x/term
module.
author Guido Berhoerster <guido+sievemgr@berhoerster.name>
date Sat Dec 12 20:44:35 2020 +0100 (2 months ago)
parents 44c07eb8ef08
children 46356977b11b
files cmd/sievemgr/common.go cmd/sievemgr/edit.go go.mod go.sum
line diff
     1.1 --- a/cmd/sievemgr/common.go	Thu Dec 03 13:52:28 2020 +0100
     1.2 +++ b/cmd/sievemgr/common.go	Sat Dec 12 20:44:35 2020 +0100
     1.3 @@ -34,7 +34,7 @@
     1.4  
     1.5  	"go.guido-berhoerster.org/managesieve"
     1.6  	"go.guido-berhoerster.org/sievemgr/cmd/sievemgr/internal/config"
     1.7 -	"golang.org/x/crypto/ssh/terminal"
     1.8 +	"golang.org/x/term"
     1.9  )
    1.10  
    1.11  var errTooBig = errors.New("too big")
    1.12 @@ -77,7 +77,7 @@
    1.13  	}
    1.14  
    1.15  	io.WriteString(w, "Password: ")
    1.16 -	rawPassword, err := terminal.ReadPassword(fd)
    1.17 +	rawPassword, err := term.ReadPassword(fd)
    1.18  	io.WriteString(w, "\n")
    1.19  	if err != nil {
    1.20  		return fmt.Errorf("failed to read password: %s", err)
     2.1 --- a/cmd/sievemgr/edit.go	Thu Dec 03 13:52:28 2020 +0100
     2.2 +++ b/cmd/sievemgr/edit.go	Sat Dec 12 20:44:35 2020 +0100
     2.3 @@ -33,7 +33,7 @@
     2.4  
     2.5  	"go.guido-berhoerster.org/managesieve"
     2.6  	"go.guido-berhoerster.org/sievemgr/cmd/sievemgr/internal/config"
     2.7 -	"golang.org/x/crypto/ssh/terminal"
     2.8 +	"golang.org/x/term"
     2.9  )
    2.10  
    2.11  func init() {
    2.12 @@ -119,8 +119,8 @@
    2.13  
    2.14  	scriptName := args[0]
    2.15  
    2.16 -	if !terminal.IsTerminal(int(os.Stdin.Fd())) ||
    2.17 -		!terminal.IsTerminal(int(os.Stdout.Fd())) {
    2.18 +	if !term.IsTerminal(int(os.Stdin.Fd())) ||
    2.19 +		!term.IsTerminal(int(os.Stdout.Fd())) {
    2.20  		return fmt.Errorf("the edit subcommand can only be used interactively\n")
    2.21  	}
    2.22  
     3.1 --- a/go.mod	Thu Dec 03 13:52:28 2020 +0100
     3.2 +++ b/go.mod	Sat Dec 12 20:44:35 2020 +0100
     3.3 @@ -4,5 +4,5 @@
     3.4  
     3.5  require (
     3.6  	go.guido-berhoerster.org/managesieve v0.0.0-20201027164714-f9bb517e9447
     3.7 -	golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897
     3.8 +	golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf
     3.9  )
     4.1 --- a/go.sum	Thu Dec 03 13:52:28 2020 +0100
     4.2 +++ b/go.sum	Sat Dec 12 20:44:35 2020 +0100
     4.3 @@ -1,16 +1,14 @@
     4.4 -go.guido-berhoerster.org/managesieve v0.0.0-20201026131555-3fe1614de42c h1:4HErjjy83de5F6xWn9Fd+N31KDJh0h1jibO6n0Ye6lw=
     4.5 -go.guido-berhoerster.org/managesieve v0.0.0-20201026131555-3fe1614de42c/go.mod h1:uvqvWGFO2zONQiEQuDNH37Mg2pM7gTsDZSXtBOSmj98=
     4.6 -go.guido-berhoerster.org/managesieve v0.0.0-20201026142443-8413916df2be h1:pKZGpXqtVG/1d16ZzVMYzjXV09q1jPU+6BsdvVVVqZU=
     4.7 -go.guido-berhoerster.org/managesieve v0.0.0-20201026142443-8413916df2be/go.mod h1:uvqvWGFO2zONQiEQuDNH37Mg2pM7gTsDZSXtBOSmj98=
     4.8  go.guido-berhoerster.org/managesieve v0.0.0-20201027164714-f9bb517e9447 h1:VdMnQ1Nq0N6cY/ViKe1v0gUURhyWCN2WgCPJfnz6c9Y=
     4.9  go.guido-berhoerster.org/managesieve v0.0.0-20201027164714-f9bb517e9447/go.mod h1:uvqvWGFO2zONQiEQuDNH37Mg2pM7gTsDZSXtBOSmj98=
    4.10  golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
    4.11  golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
    4.12 -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E=
    4.13 -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
    4.14  golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
    4.15  golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
    4.16  golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
    4.17  golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884=
    4.18  golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
    4.19 +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw=
    4.20 +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
    4.21 +golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf h1:MZ2shdL+ZM/XzY3ZGOnh4Nlpnxz5GSOhOmtHo3iPU6M=
    4.22 +golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
    4.23  golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=