From ffbe39bb83796f0326f737794b2942971825aae3 Mon Sep 17 00:00:00 2001 From: Maxim Lebedev Date: Wed, 13 Dec 2017 15:15:18 +0500 Subject: [PATCH] :art: Format comments and code width Use 100 instead 80 --- content.go | 3 ++- create_account.go | 11 +++++------ create_page.go | 5 ++--- edit_account_info.go | 10 ++++------ edit_page.go | 8 +++----- get_account_info.go | 4 ++-- get_views.go | 15 +++++++-------- revoke_access_token.go | 7 +++---- 8 files changed, 28 insertions(+), 35 deletions(-) diff --git a/content.go b/content.go index 2585cd7..dfa09d3 100644 --- a/content.go +++ b/content.go @@ -78,7 +78,8 @@ func domToNode(domNode *html.Node) interface{} { var nodeElement NodeElement switch strings.ToLower(domNode.Data) { - case "a", "aside", "b", "blockquote", "br", "code", "em", "figcaption", "figure", "h3", "h4", "hr", "i", "iframe", "img", "li", "ol", "p", "pre", "s", "strong", "u", "ul", "video": + case "a", "aside", "b", "blockquote", "br", "code", "em", "figcaption", "figure", "h3", "h4", + "hr", "i", "iframe", "img", "li", "ol", "p", "pre", "s", "strong", "u", "ul", "video": nodeElement.Tag = domNode.Data for i := range domNode.Attr { diff --git a/create_account.go b/create_account.go index 0bf6f17..e1181a2 100644 --- a/create_account.go +++ b/create_account.go @@ -38,17 +38,16 @@ type Account struct { func CreateAccount(account *Account) (*Account, error) { args := http.AcquireArgs() - // Account name, helps users with several accounts remember which they are - // currently using. Displayed to the user above the "Edit/Publish" button - // on Telegra.ph, other users don't see this name. + // Account name, helps users with several accounts remember which they are currently using. + // Displayed to the user above the "Edit/Publish" button on Telegra.ph, other users don't see + // this name. args.Add("short_name", account.ShortName) // required // Default author name used when creating new articles. args.Add("author_name", account.AuthorName) - // Default profile link, opened when users click on the author's name - // below the title. Can be any link, not necessarily to a Telegram profile - // or channel. + // Default profile link, opened when users click on the author's name below the title. Can be any + // link, not necessarily to a Telegram profile or channel. args.Add("author_url", account.AuthorURL) body, err := request("createAccount", "", args) diff --git a/create_page.go b/create_page.go index e471da7..bc740e3 100644 --- a/create_page.go +++ b/create_page.go @@ -57,9 +57,8 @@ func (account *Account) CreatePage(page *Page, returnContent bool) (*Page, error } if page.AuthorURL != "" { - // Profile link, opened when users click on the author's name below - // the title. Can be any link, not necessarily to a Telegram profile - // or channel. + // Profile link, opened when users click on the author's name below the title. Can be any + // link, not necessarily to a Telegram profile or channel. args.Add("author_url", page.AuthorURL) } diff --git a/edit_account_info.go b/edit_account_info.go index 07c723f..522b266 100644 --- a/edit_account_info.go +++ b/edit_account_info.go @@ -5,9 +5,8 @@ import ( http "github.com/valyala/fasthttp" ) -// EditAccountInfo update information about a Telegraph account. Pass only the -// parameters that you want to edit. On success, returns an Account object -// with the default fields. +// EditAccountInfo update information about a Telegraph account. Pass only the parameters that you +// want to edit. On success, returns an Account object with the default fields. func (account *Account) EditAccountInfo(update *Account) (*Account, error) { args := http.AcquireArgs() @@ -20,9 +19,8 @@ func (account *Account) EditAccountInfo(update *Account) (*Account, error) { // New default author name used when creating new articles. args.Add("author_name", update.AuthorName) - // New default profile link, opened when users click on the author's name - // below the title. Can be any link, not necessarily to a Telegram profile - // or channel. + // New default profile link, opened when users click on the author's name below the title. Can be + // any link, not necessarily to a Telegram profile or channel. args.Add("author_url", update.AuthorURL) body, err := request("editAccountInfo", "", args) diff --git a/edit_page.go b/edit_page.go index b24bce7..2ee0671 100644 --- a/edit_page.go +++ b/edit_page.go @@ -7,8 +7,7 @@ import ( http "github.com/valyala/fasthttp" ) -// EditPage edit an existing Telegraph page. On success, returns a Page -// object. +// EditPage edit an existing Telegraph page. On success, returns a Page object. func (account *Account) EditPage(update *Page, returnContent bool) (*Page, error) { args := http.AcquireArgs() @@ -24,9 +23,8 @@ func (account *Account) EditPage(update *Page, returnContent bool) (*Page, error } if update.AuthorURL != "" { - // Profile link, opened when users click on the author's name below - // the title. Can be any link, not necessarily to a Telegram profile - // or channel. + // Profile link, opened when users click on the author's name below the title. Can be any + // link, not necessarily to a Telegram profile or channel. args.Add("author_url", update.AuthorURL) } diff --git a/get_account_info.go b/get_account_info.go index 9a060ce..437466f 100644 --- a/get_account_info.go +++ b/get_account_info.go @@ -34,8 +34,8 @@ func (account *Account) GetAccountInfo(fields ...string) (*Account, error) { // Access token of the Telegraph account. args.Add("access_token", account.AccessToken) // required - // List of account fields to return. Available fields: short_name, - // author_name, author_url, auth_url, page_count. + // List of account fields to return. + // Available fields: short_name, author_name, author_url, auth_url, page_count. args.Add("fields", fmt.Sprint(`["`, strings.Join(fields, `","`), `"]`)) body, err := request("getAccountInfo", "", args) diff --git a/get_views.go b/get_views.go index 4bc4c20..b0ad2e5 100644 --- a/get_views.go +++ b/get_views.go @@ -19,26 +19,25 @@ func GetViews(path string, hour, day, month, year int) (*PageViews, error) { args := http.AcquireArgs() if hour > -1 { - // If passed, the number of page views for the requested hour will - // be returned. + // If passed, the number of page views for the requested hour will be returned. args.Add("hour", strconv.Itoa(hour)) } if day > 0 { - // Required if hour is passed. If passed, the number of page views - // for the requested day will be returned. + // Required if hour is passed. If passed, the number of page views for the requested day will + // be returned. args.Add("day", strconv.Itoa(day)) } if month > 0 { - // Required if day is passed. If passed, the number of page views - // for the requested month will be returned. + // Required if day is passed. If passed, the number of page views for the requested month will + // be returned. args.Add("month", strconv.Itoa(month)) } if year > 0 { - // Required if month is passed. If passed, the number of page views - // for the requested year will be returned. + // Required if month is passed. If passed, the number of page views for the requested year + // will be returned. args.Add("year", strconv.Itoa(year)) } diff --git a/revoke_access_token.go b/revoke_access_token.go index 15cc6fc..19abfc5 100644 --- a/revoke_access_token.go +++ b/revoke_access_token.go @@ -5,10 +5,9 @@ import ( http "github.com/valyala/fasthttp" ) -// RevokeAccessToken revoke access_token and generate a new one, for example, -// if the user would like to reset all connected sessions, or you have reasons -// to believe the token was compromised. On success, returns an Account object -// with new access_token and auth_url fields. +// RevokeAccessToken revoke access_token and generate a new one, for example, if the user would +// like to reset all connected sessions, or you have reasons to believe the token was compromised. On +// success, returns an Account object with new access_token and auth_url fields. func (account *Account) RevokeAccessToken() (*Account, error) { args := http.AcquireArgs()