Skip to content

Commit

Permalink
Minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
mrz1836 committed Dec 29, 2019
1 parent b150430 commit 7976e3f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 38 deletions.
9 changes: 3 additions & 6 deletions advertiser_profiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ func (c *Client) CreateAdvertiserProfile(profile *AdvertiserProfile, userSession
}

// Convert model response
createdProfile = new(AdvertiserProfile)
err = json.Unmarshal([]byte(response), createdProfile)
err = json.Unmarshal([]byte(response), &createdProfile)
return
}

Expand Down Expand Up @@ -65,8 +64,7 @@ func (c *Client) GetAdvertiserProfile(profileID uint64, userSessionToken string)
}

// Convert model response
profile = new(AdvertiserProfile)
err = json.Unmarshal([]byte(response), profile)
err = json.Unmarshal([]byte(response), &profile)
return
}

Expand Down Expand Up @@ -97,7 +95,6 @@ func (c *Client) UpdateAdvertiserProfile(profile *AdvertiserProfile, userSession
}

// Convert model response
updatedProfile = new(AdvertiserProfile)
err = json.Unmarshal([]byte(response), updatedProfile)
err = json.Unmarshal([]byte(response), &updatedProfile)
return
}
12 changes: 4 additions & 8 deletions campaigns.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ func (c *Client) CreateCampaign(campaign *Campaign, userSessionToken string) (cr
}

// Convert model response
createdCampaign = new(Campaign)
err = json.Unmarshal([]byte(response), createdCampaign)
err = json.Unmarshal([]byte(response), &createdCampaign)
return
}

Expand Down Expand Up @@ -69,8 +68,7 @@ func (c *Client) GetCampaign(campaignID uint64, userSessionToken string) (campai
}

// Convert model response
campaign = new(Campaign)
err = json.Unmarshal([]byte(response), campaign)
err = json.Unmarshal([]byte(response), &campaign)
return
}

Expand All @@ -91,8 +89,7 @@ func (c *Client) GetCampaignBalance(campaignID uint64) (campaign *Campaign, err
}

// Convert model response
campaign = new(Campaign)
err = json.Unmarshal([]byte(response), campaign)
err = json.Unmarshal([]byte(response), &campaign)
return
}

Expand Down Expand Up @@ -123,7 +120,6 @@ func (c *Client) UpdateCampaign(campaign *Campaign, userSessionToken string) (up
}

// Convert model response
updatedCampaign = new(Campaign)
err = json.Unmarshal([]byte(response), updatedCampaign)
err = json.Unmarshal([]byte(response), &updatedCampaign)
return
}
12 changes: 4 additions & 8 deletions goals.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ func (c *Client) CreateGoal(goal *Goal, userSessionToken string) (createdGoal *G
}

// Convert model response
createdGoal = new(Goal)
err = json.Unmarshal([]byte(response), createdGoal)
err = json.Unmarshal([]byte(response), &createdGoal)
return
}

Expand Down Expand Up @@ -66,8 +65,7 @@ func (c *Client) GetGoal(goalID uint64, userSessionToken string) (goal *Goal, er
}

// Convert model response
goal = new(Goal)
err = json.Unmarshal([]byte(response), goal)
err = json.Unmarshal([]byte(response), &goal)
return
}

Expand Down Expand Up @@ -98,8 +96,7 @@ func (c *Client) UpdateGoal(goal *Goal, userSessionToken string) (updatedGoal *G
}

// Convert model response
updatedGoal = new(Goal)
err = json.Unmarshal([]byte(response), updatedGoal)
err = json.Unmarshal([]byte(response), &updatedGoal)
return
}

Expand Down Expand Up @@ -135,7 +132,6 @@ func (c *Client) ConvertGoal(goalName, visitorSessionID, additionalData, customU
}

// Convert model response
conversion = new(Conversion)
err = json.Unmarshal([]byte(response), conversion)
err = json.Unmarshal([]byte(response), &conversion)
return
}
9 changes: 3 additions & 6 deletions links.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ func (c *Client) CreateLink(link *Link, userSessionToken string) (createdLink *L
}

// Convert model response
createdLink = new(Link)
err = json.Unmarshal([]byte(response), createdLink)
err = json.Unmarshal([]byte(response), &createdLink)
return
}

Expand Down Expand Up @@ -65,8 +64,7 @@ func (c *Client) GetLink(linkID uint64, userSessionToken string) (link *Link, er
}

// Convert model response
link = new(Link)
err = json.Unmarshal([]byte(response), link)
err = json.Unmarshal([]byte(response), &link)
return
}

Expand Down Expand Up @@ -94,7 +92,6 @@ func (c *Client) CheckLink(shortCode string) (link *Link, err error) {
}

// Convert model response
link = new(Link)
err = json.Unmarshal([]byte(response), link)
err = json.Unmarshal([]byte(response), &link)
return
}
15 changes: 5 additions & 10 deletions users.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ func (c *Client) CreateUser(user *User) (createdUser *User, err error) {
}

// Convert model response
createdUser = new(User)
err = json.Unmarshal([]byte(response), createdUser)
err = json.Unmarshal([]byte(response), &createdUser)
return
}

Expand Down Expand Up @@ -72,8 +71,7 @@ func (c *Client) UpdateUser(user *User, userSessionToken string) (updatedUser *U
}

// Convert model response
updatedUser = new(User)
err = json.Unmarshal([]byte(response), updatedUser)
err = json.Unmarshal([]byte(response), &updatedUser)
return
}

Expand Down Expand Up @@ -110,8 +108,7 @@ func (c *Client) GetUser(byID uint64, byEmail string) (user *User, err error) {
}

// Convert model response
user = new(User)
err = json.Unmarshal([]byte(response), user)
err = json.Unmarshal([]byte(response), &user)
return
}

Expand All @@ -132,8 +129,7 @@ func (c *Client) GetUserBalance(userID uint64) (user *User, err error) {
}

// Convert model response
user = new(User)
err = json.Unmarshal([]byte(response), user)
err = json.Unmarshal([]byte(response), &user)
return
}

Expand Down Expand Up @@ -161,8 +157,7 @@ func (c *Client) CurrentUser(userSessionToken string) (user *User, err error) {
}

// Convert model response
user = new(User)
err = json.Unmarshal([]byte(response), user)
err = json.Unmarshal([]byte(response), &user)
return
}

Expand Down

0 comments on commit 7976e3f

Please sign in to comment.