Closed andig closed 3 years ago
Imho the staticcheck is broken as it does not respect the replace directive. Upgrade or get rid of the check?
Should be ready for review.
Re: staticcheck - I'd prefer to keep it around and consciously ignore errors we know aren't actually errors.
Shall we include the captcha solver (legal?) or do something simple like:
tmpFile, err := ioutil.TempFile(os.TempDir(), "captcha-*.svg")
if err != nil {
return "", fmt.Errorf("cannot create temp file: %w", err)
}
if _, err := io.Copy(tmpFile, svg); err != nil {
return "", fmt.Errorf("cannot write temp file: %w", err)
}
_ = tmpFile.Close()
if err := open.Run(tmpFile.Name()); err != nil {
return "", fmt.Errorf("cannot open captcha for display: %w", err)
}
fmt.Println("Captcha is now being opened in default application for svg files.")
fmt.Println()
fmt.Print("Please enter captcha: ")
reader := bufio.NewReader(os.Stdin)
captcha, err := reader.ReadString('\n')
return strings.TrimSpace(captcha), err
I've changed it anyway to get rid of the forked dependency. IMHO ready to merge. And given https://github.com/bogosj/tesla/issues/58 should we also do a 1.1.0 release then?
Fix #56.
Todos:
login.go
go.mod