mirror of
https://github.com/int128/kubelogin.git
synced 2026-08-23 21:06:15 +00:00
17 lines
324 B
Go
17 lines
324 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
)
|
|
|
|
// ReceiveAuthCodeFromCLI receives an auth code from CLI
|
|
func ReceiveAuthCodeFromCLI(ctx context.Context, authCodeCh chan<- string, errCh chan<- error) {
|
|
var authCode string
|
|
if _, err := fmt.Scanln(&authCode); err != nil {
|
|
errCh <- err
|
|
} else {
|
|
authCodeCh <- authCode
|
|
}
|
|
}
|