go fmt
This commit is contained in:
parent
653a8a0dc0
commit
d964a951a0
|
@ -116,8 +116,6 @@ func (c *Client) Auth(username, password, twoFactorCode string, info *AuthInfo)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("%#v\n", info)
|
|
||||||
|
|
||||||
proofs, err := srp([]byte(password), info)
|
proofs, err := srp([]byte(password), info)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
const Version = 2
|
const Version = 3
|
||||||
|
|
||||||
const headerAPIVersion = "X-Pm-Apiversion"
|
const headerAPIVersion = "X-Pm-Apiversion"
|
||||||
|
|
||||||
|
@ -39,15 +39,17 @@ func (err apiError) Error() string {
|
||||||
|
|
||||||
// Client is a ProtonMail API client.
|
// Client is a ProtonMail API client.
|
||||||
type Client struct {
|
type Client struct {
|
||||||
HTTPClient *http.Client
|
|
||||||
RootURL string
|
RootURL string
|
||||||
AppVersion string
|
AppVersion string
|
||||||
|
|
||||||
ClientID string
|
ClientID string
|
||||||
ClientSecret string
|
ClientSecret string
|
||||||
|
|
||||||
|
HTTPClient *http.Client
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) newRequest(method, path string, body io.Reader) (*http.Request, error) {
|
func (c *Client) newRequest(method, path string, body io.Reader) (*http.Request, error) {
|
||||||
req, err := http.NewRequest(method, c.RootURL + path, body)
|
req, err := http.NewRequest(method, c.RootURL+path, body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ func reverse(b []byte) {
|
||||||
func itoa(i *big.Int, l int) []byte {
|
func itoa(i *big.Int, l int) []byte {
|
||||||
b := i.Bytes()
|
b := i.Bytes()
|
||||||
reverse(b)
|
reverse(b)
|
||||||
padding := make([]byte, l/8 - len(b))
|
padding := make([]byte, l/8-len(b))
|
||||||
b = append(b, padding...)
|
b = append(b, padding...)
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue