Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot scan command inputs #121

Open
etiennepericat opened this issue Dec 15, 2022 · 0 comments
Open

Cannot scan command inputs #121

etiennepericat opened this issue Dec 15, 2022 · 0 comments

Comments

@etiennepericat
Copy link

If i'm launching my app with fresh, i'm not able to scan user input from the command line. (tested with bufio and others go scanners)

This bunch of code (from https://developers.google.com/gmail/api/quickstart/go) :

	authURL := config.AuthCodeURL("state-token", oauth2.AccessTypeOffline)
	fmt.Printf("Go to the following link in your browser then type the "+
		"authorization code: \n%v\n", authURL)
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	err := scanner.Err()
	if err != nil {
		log.Fatalf("Unable to retrieve authorization code: %v", err)
	}
	authCode := scanner.Text()
	fmt.Printf("Auth code: %s\n", authCode)

will never stop (it should stop at "Scan()" on line 5)

If I'm launching my app without fresh this code works.

Do someone knows how can I fix this ?

Thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant