diff --git a/advertiser_profiles.go b/advertiser_profiles.go index 5661048..01bd7bd 100644 --- a/advertiser_profiles.go +++ b/advertiser_profiles.go @@ -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 } @@ -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 } @@ -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 } diff --git a/campaigns.go b/campaigns.go index 28788fd..891a13b 100644 --- a/campaigns.go +++ b/campaigns.go @@ -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 } @@ -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 } @@ -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 } @@ -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 } diff --git a/goals.go b/goals.go index 3676999..f2d90f9 100644 --- a/goals.go +++ b/goals.go @@ -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 } @@ -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 } @@ -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 } @@ -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 } diff --git a/links.go b/links.go index 3874244..44c7d7d 100644 --- a/links.go +++ b/links.go @@ -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 } @@ -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 } @@ -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 } diff --git a/users.go b/users.go index 3c65bc3..7691190 100644 --- a/users.go +++ b/users.go @@ -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 } @@ -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 } @@ -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 } @@ -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 } @@ -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 }