()
| 149 | } |
| 150 | |
| 151 | func waitForEnablement() error { |
| 152 | fmt.Println() |
| 153 | fmt.Println("After enabling the API in Google Cloud Console:") |
| 154 | fmt.Println(" 1. Click 'ENABLE' on the API page") |
| 155 | fmt.Println(" 2. Wait a few seconds for it to activate") |
| 156 | fmt.Println() |
| 157 | fmt.Print("Press ENTER when done (or 'q' to quit): ") |
| 158 | |
| 159 | reader := bufio.NewReader(os.Stdin) |
| 160 | input, _ := reader.ReadString('\n') |
| 161 | input = strings.TrimSpace(strings.ToLower(input)) |
| 162 | |
| 163 | if input == "q" || input == "quit" { |
| 164 | return fmt.Errorf("API enablement cancelled by user") |
| 165 | } |
| 166 | |
| 167 | fmt.Println() |
| 168 | fmt.Println("Retrying...") |
| 169 | return nil |
| 170 | } |
| 171 | |
| 172 | // openBrowser opens a URL in the default browser |
| 173 | func openBrowser(url string) error { |
no outgoing calls
no test coverage detected