stub teller.Init
This commit is contained in:
20
src/bank/teller/init.go
Normal file
20
src/bank/teller/init.go
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
package teller
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bufio"
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
func Init(ctx context.Context) error {
|
||||||
|
if Token == "" {
|
||||||
|
} else if reader := bufio.NewReader(os.Stdin); false {
|
||||||
|
} else if fmt.Println("Token already exists; are you sure [nY]?"); false {
|
||||||
|
} else if text, _ := reader.ReadString('\n'); !strings.Contains(text, "Y") {
|
||||||
|
return fmt.Errorf("token already exists")
|
||||||
|
}
|
||||||
|
|
||||||
|
return ctx.Err()
|
||||||
|
}
|
||||||
@@ -1 +0,0 @@
|
|||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user