mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +00:00
telegram: find USERNAME when USER env not found for windows.
This commit is contained in:
parent
9f14d00f3c
commit
e5450492bb
|
@ -32,6 +32,9 @@ func NewDefaultTotpKey() (*otp.Key, error) {
|
|||
|
||||
if len(totpAccountName) == 0 {
|
||||
user, ok := os.LookupEnv("USER")
|
||||
if !ok {
|
||||
user, ok = os.LookupEnv("USERNAME")
|
||||
}
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("can not get USER env var for totp account name")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user