Skip to content

Commit

Permalink
replaces deprecated terminal module in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
obrientimothya committed Aug 16, 2023
1 parent d00a78f commit 409cc38
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions example/basicauth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"syscall"

"github.com/google/go-github/v53/github"
"golang.org/x/crypto/ssh/terminal"
"golang.org/x/term"
)

func main() {
Expand All @@ -32,7 +32,7 @@ func main() {
username, _ := r.ReadString('\n')

fmt.Print("GitHub Password: ")
bytePassword, _ := terminal.ReadPassword(int(syscall.Stdin))
bytePassword, _ := term.ReadPassword(int(syscall.Stdin))
password := string(bytePassword)

tp := github.BasicAuthTransport{
Expand Down
4 changes: 2 additions & 2 deletions example/tagprotection/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"syscall"

"github.com/google/go-github/v53/github"
"golang.org/x/crypto/ssh/terminal"
"golang.org/x/term"
)

func main() {
Expand All @@ -39,7 +39,7 @@ func main() {
pattern = strings.TrimSpace(pattern)

fmt.Print("GitHub Token: ")
byteToken, _ := terminal.ReadPassword(int(syscall.Stdin))
byteToken, _ := term.ReadPassword(int(syscall.Stdin))
println()
token := string(byteToken)

Expand Down
4 changes: 2 additions & 2 deletions example/tokenauth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import (
"syscall"

"github.com/google/go-github/v53/github"
"golang.org/x/crypto/ssh/terminal"
"golang.org/x/term"
)

func main() {
fmt.Print("GitHub Token: ")
byteToken, _ := terminal.ReadPassword(int(syscall.Stdin))
byteToken, _ := term.ReadPassword(int(syscall.Stdin))
println()
token := string(byteToken)

Expand Down

0 comments on commit 409cc38

Please sign in to comment.