Skip to content

Commit 5ddd6f8

Browse files
committed
project: refactoring
1 parent 74658c4 commit 5ddd6f8

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

action.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ const (
1818
type Action struct {
1919
Name string `json:"action"`
2020
ItemID string `json:"item_id"`
21-
RefId string `json:"ref_id,omitempty"`
21+
RefID string `json:"ref_id,omitempty"`
2222
Tags string `json:"tags,omitempty"`
2323
Time int64 `json:"time,omitempty"`
2424
Title string `json:"title,omitempty"`
25-
Url string `json:"url,omitempty"`
25+
URL string `json:"url,omitempty"`
2626
OldTag string `json:"old_tag,omitempty"`
2727
NewTag string `json:"new_tag,omitempty"`
2828
}

pocket.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414

1515
const (
1616
host = "https://getpocket.com/v3"
17-
authorizeUrl = "https://getpocket.com/auth/authorize?request_token=%s&redirect_uri=%s"
17+
authorizeURL = "https://getpocket.com/auth/authorize?request_token=%s&redirect_uri=%s"
1818

1919
endpointAdd = "/add"
2020
endpointModify = "/send"
@@ -138,7 +138,7 @@ func (c Client) GetAuthorizationURL(requestToken string) (string, error) {
138138
return "", ErrEmptyRedirectURL
139139
}
140140

141-
return fmt.Sprintf(authorizeUrl, requestToken, c.redirectURL), nil
141+
return fmt.Sprintf(authorizeURL, requestToken, c.redirectURL), nil
142142
}
143143

144144
// GetRequestToken returns the request token (code), which will be used later to authenticate the user in your application.

pocket_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ func TestClient_Modify(t *testing.T) {
188188
modifyInput: ModifyInput{
189189
AccessToken: "access-token",
190190
Actions: []Action{
191-
{Name: ActionAdd, ItemID: "987", Url: "https://github.com", Title: "Github"},
191+
{Name: ActionAdd, ItemID: "987", URL: "https://github.com", Title: "Github"},
192192
{Name: ActionArchive, ItemID: "654", Time: time.Now().Unix()},
193193
{Name: ActionFavorite, ItemID: "321", Time: time.Now().Unix()},
194194
},
@@ -205,7 +205,7 @@ func TestClient_Modify(t *testing.T) {
205205
modifyInput: ModifyInput{
206206
AccessToken: "",
207207
Actions: []Action{
208-
{Name: ActionAdd, ItemID: "987", Url: "https://github.com", Title: "Github"},
208+
{Name: ActionAdd, ItemID: "987", URL: "https://github.com", Title: "Github"},
209209
{Name: ActionArchive, ItemID: "654", Time: time.Now().Unix()},
210210
{Name: ActionFavorite, ItemID: "321", Time: time.Now().Unix()},
211211
},
@@ -235,7 +235,7 @@ func TestClient_Modify(t *testing.T) {
235235
modifyInput: ModifyInput{
236236
AccessToken: "access-token",
237237
Actions: []Action{
238-
{Name: ActionAdd, ItemID: "987", Url: "https://github.com", Title: "Github"},
238+
{Name: ActionAdd, ItemID: "987", URL: "https://github.com", Title: "Github"},
239239
{Name: ActionArchive, ItemID: "654", Time: time.Now().Unix()},
240240
{Name: ActionFavorite, ItemID: "321", Time: time.Now().Unix()},
241241
},
@@ -293,9 +293,9 @@ func TestClient_Retrieving(t *testing.T) {
293293
{
294294
ID: "229279689",
295295
ResolvedID: "229279689",
296-
GivenUrl: `http://www.grantland.com/blog/the-triangle/post/_/id/38347/ryder-cup-preview`,
296+
GivenURL: `http://www.grantland.com/blog/the-triangle/post/_/id/38347/ryder-cup-preview`,
297297
GivenTitle: `The Massive Ryder Cup Preview - The Triangle Blog - Grantland`,
298-
ResolvedUrl: `http://www.grantland.com/blog/the-triangle/post/_/id/38347/ryder-cup-preview`,
298+
ResolvedURL: `http://www.grantland.com/blog/the-triangle/post/_/id/38347/ryder-cup-preview`,
299299
ResolvedTitle: `The Massive Ryder Cup Preview`,
300300
Favorite: "0",
301301
Status: "0",

response.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ type Authorization struct {
1515
type Item struct {
1616
ID string
1717
ResolvedID string
18-
GivenUrl string
19-
ResolvedUrl string
18+
GivenURL string
19+
ResolvedURL string
2020
GivenTitle string
2121
ResolvedTitle string
2222
Favorite string
@@ -30,8 +30,8 @@ type Item struct {
3030

3131
func (i *Item) fillAllFields(result gjson.Result) {
3232
i.ResolvedID = result.Get(fmt.Sprintf("list.%s.resolved_id", i.ID)).String()
33-
i.GivenUrl = result.Get(fmt.Sprintf("list.%s.given_url", i.ID)).String()
34-
i.ResolvedUrl = result.Get(fmt.Sprintf("list.%s.resolved_url", i.ID)).String()
33+
i.GivenURL = result.Get(fmt.Sprintf("list.%s.given_url", i.ID)).String()
34+
i.ResolvedURL = result.Get(fmt.Sprintf("list.%s.resolved_url", i.ID)).String()
3535
i.GivenTitle = result.Get(fmt.Sprintf("list.%s.given_title", i.ID)).String()
3636
i.ResolvedTitle = result.Get(fmt.Sprintf("list.%s.resolved_title", i.ID)).String()
3737
i.Favorite = result.Get(fmt.Sprintf("list.%s.favorite", i.ID)).String()

0 commit comments

Comments
 (0)