Skip to content

Commit

Permalink
Fixes to parsing float32 to string for REST call
Browse files Browse the repository at this point in the history
  • Loading branch information
kariudo committed Feb 9, 2015
1 parent 0948adc commit ecf1567
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gopushbullet.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"net/http"
"net/url"
"os"
"strconv"
)

//Error (any non-200 error code) contain information on the kind of error that happened.
Expand Down Expand Up @@ -530,9 +531,9 @@ func (c *Client) UpdatePreferences(preferences Preferences) error {
}

//GetPushHistory gets pushes modified after the provided timestamp
func GetPushHistory(modifiedAfter float32) ([]PushMessage, error) {
func (c *Client) GetPushHistory(modifiedAfter float32) ([]PushMessage, error) {
var pushList PushList
responseBody, apiError, err := c.makeCall("GET", "pushes?modified_after="+modifiedAfter, nil)
responseBody, apiError, err := c.makeCall("GET", "pushes?modified_after="+strconv.FormatFloat(float64(modifiedAfter), 'f', 4, 32), nil)
if err != nil {
log.Println("Error getting push history: ", apiError, err)
return pushList.Pushes, err
Expand Down

0 comments on commit ecf1567

Please sign in to comment.