code: func checkToken(ctx context.Context, a *auth.Authenticator) int {
  	// Grab the active access token.
  	tok, err := a.GetAccessToken(time.Minute)
  	if err != nil {
  		fmt.Fprintf(os.Stderr, "Can't grab an access token: %s\n", err)
  		return ExitCodeNoValidToken
  	}
  
  	// Ask Google endpoint for details of the token.
  	info, err := googleoauth.GetTokenInfo(ctx, googleoauth.TokenInfoParams{
  		AccessToken: tok.AccessToken,
  	})
  	if err != nil {
  		fmt.Fprintf(os.Stderr, "Failed to call token info endpoint: %s\n", err)
  		if err == googleoauth.ErrBadToken {
  			return ExitCodeNoValidToken
  		}
  		return ExitCodeInternalError
  	}
  
  	// Email is set only if the token has userinfo.email scope.
  	if info.Email != "" {
  		fmt.Printf("Logged in as %s.\n", info.Email)
  	} else {
  		fmt.Printf("Logged in as uid %q.\n", info.Sub)
  	}
  	fmt.Printf("OAuth token details:\n")
  	fmt.Printf("  Client ID: %s\n", info.Aud)
  	fmt.Printf("  Scopes:\n")
  	for _, scope := range strings.Split(info.Scope, " ") {
  		fmt.Printf("    %s\n", scope)
  	}
  
  	return ExitCodeSuccess
  }
docs: ////////////////////////////////////////////////////////////////////////////////
  // checkToken prints information about the token carried by the authenticator.
  //
  // Prints errors to stderr and returns corresponding process exit code.