(httpClient *http.Client, hostname, token string)
| 165 | } |
| 166 | |
| 167 | func getViewer(httpClient *http.Client, hostname, token string) (string, error) { |
| 168 | authedClient := *httpClient |
| 169 | authedClient.Transport = api.AddAuthTokenHeaderWithRefresh(httpClient.Transport, cfg{token: token}) |
| 170 | return api.CurrentLoginName(api.NewClientFromHTTP(&authedClient), hostname) |
| 171 | } |
| 172 | |
| 173 | func waitForEnter(r io.Reader) error { |
| 174 | scanner := bufio.NewScanner(r) |