Removed Printf usage for accelerate

Die, die Printf!
This commit is contained in:
Maxim Lebedev 2017-12-13 15:04:05 +05:00
parent 7d9e3b38ae
commit 5f83fd5342
No known key found for this signature in database
GPG Key ID: F8978F46FF0FFA4F
9 changed files with 9 additions and 29 deletions

View File

@ -1,8 +1,6 @@
package telegraph
import (
"fmt"
json "github.com/pquerna/ffjson/ffjson"
http "github.com/valyala/fasthttp"
)
@ -53,8 +51,7 @@ func CreateAccount(account *Account) (*Account, error) {
// or channel.
args.Add("author_url", account.AuthorURL)
url := fmt.Sprintf(APIEndpoint, "createAccount")
body, err := request(url, &args)
body, err := request("createAccount", "", args)
if err != nil {
return nil, err
}

View File

@ -1,7 +1,6 @@
package telegraph
import (
"fmt"
"strconv"
json "github.com/pquerna/ffjson/ffjson"
@ -75,8 +74,7 @@ func (account *Account) CreatePage(page *Page, returnContent bool) (*Page, error
// Content of the page.
args.Add("content", string(content)) // required
url := fmt.Sprintf(APIEndpoint, "createPage")
body, err := request(url, &args)
body, err := request("createPage", "", args)
if err != nil {
return nil, err
}

View File

@ -1,8 +1,6 @@
package telegraph
import (
"fmt"
json "github.com/pquerna/ffjson/ffjson"
http "github.com/valyala/fasthttp"
)
@ -27,8 +25,7 @@ func (account *Account) EditAccountInfo(update *Account) (*Account, error) {
// or channel.
args.Add("author_url", update.AuthorURL)
url := fmt.Sprintf(APIEndpoint, "editAccountInfo")
body, err := request(url, &args)
body, err := request("editAccountInfo", "", args)
if err != nil {
return nil, err
}

View File

@ -1,7 +1,6 @@
package telegraph
import (
"fmt"
"strconv"
json "github.com/pquerna/ffjson/ffjson"
@ -42,8 +41,7 @@ func (account *Account) EditPage(update *Page, returnContent bool) (*Page, error
// Content of the page.
args.Add("content", string(content)) // required
url := fmt.Sprintf(PathEndpoint, "editPage", update.Path)
body, err := request(url, &args)
body, err := request("editPage", update.Path, args)
if err != nil {
return nil, err
}

View File

@ -20,8 +20,7 @@ func (account *Account) GetAccountInfo(fields ...string) (*Account, error) {
// author_name, author_url, auth_url, page_count.
args.Add("fields", fmt.Sprint(`["`, strings.Join(fields, `","`), `"]`))
url := fmt.Sprintf(APIEndpoint, "getAccountInfo")
body, err := request(url, &args)
body, err := request("getAccountInfo", "", args)
if err != nil {
return nil, err
}

View File

@ -1,7 +1,6 @@
package telegraph
import (
"fmt"
"strconv"
json "github.com/pquerna/ffjson/ffjson"
@ -15,8 +14,7 @@ func GetPage(path string, returnContent bool) (*Page, error) {
// If true, content field will be returned in Page object.
args.Add("return_content", strconv.FormatBool(returnContent))
url := fmt.Sprintf(PathEndpoint, "getPage", path)
body, err := request(url, &args)
body, err := request("getPage", path, args)
if err != nil {
return nil, err
}

View File

@ -1,7 +1,6 @@
package telegraph
import (
"fmt"
"strconv"
json "github.com/pquerna/ffjson/ffjson"
@ -32,8 +31,7 @@ func (account *Account) GetPageList(offset, limit int) (*PageList, error) {
// Limits the number of pages to be retrieved.
args.Add("limit", strconv.Itoa(limit))
url := fmt.Sprintf(APIEndpoint, "getPageList")
body, err := request(url, &args)
body, err := request("getPageList", "", args)
if err != nil {
return nil, err
}

View File

@ -1,7 +1,6 @@
package telegraph
import (
"fmt"
"strconv"
json "github.com/pquerna/ffjson/ffjson"
@ -43,8 +42,7 @@ func GetViews(path string, hour, day, month, year int) (*PageViews, error) {
args.Add("year", strconv.Itoa(year))
}
url := fmt.Sprintf(PathEndpoint, "getViews", path)
body, err := request(url, &args)
body, err := request("getViews", path, args)
if err != nil {
return nil, err
}

View File

@ -1,8 +1,6 @@
package telegraph
import (
"fmt"
json "github.com/pquerna/ffjson/ffjson"
http "github.com/valyala/fasthttp"
)
@ -17,8 +15,7 @@ func (account *Account) RevokeAccessToken() (*Account, error) {
// Access token of the Telegraph account.
args.Add("access_token", account.AccessToken) // required
url := fmt.Sprintf(APIEndpoint, "revokeAccessToken")
body, err := request(url, &args)
body, err := request("revokeAccessToken", "", args)
if err != nil {
return nil, err
}