From b89a0e602f2785364d8839b6ed174fbea4858df9 Mon Sep 17 00:00:00 2001 From: itzaname Date: Sun, 8 Jan 2017 02:34:03 -0500 Subject: [PATCH] Propperly conver int to string --- item.go | 3 ++- message.go | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/item.go b/item.go index dc7a7ed..4fc5505 100644 --- a/item.go +++ b/item.go @@ -8,6 +8,7 @@ import ( "net/http" "net/url" "regexp" + "strconv" ) // Item struct containing data on retrieved items @@ -181,7 +182,7 @@ func (s *Session) GetModels(user string) ([]Item, error) { itm := obj.(map[string]interface{}) iInfo := itm["Item"].(map[string]interface{}) iCreator := itm["Creator"].(map[string]interface{}) - Data = append(Data, Item{"", string(int(iInfo["AssetId"].(float64))), "", string(int(iCreator["Id"].(float64))), iCreator["Name"].(string), "Model", iInfo["Name"].(string), false, true}) + Data = append(Data, Item{"", strconv.Itoa(int(iInfo["AssetId"].(float64))), "", strconv.Itoa(int(iCreator["Id"].(float64))), iCreator["Name"].(string), "Model", iInfo["Name"].(string), false, true}) } return Data, nil diff --git a/message.go b/message.go index cb15c63..ea2650d 100644 --- a/message.go +++ b/message.go @@ -48,10 +48,10 @@ func (s *Session) GetInbox() ([]Message, error) { sender := msg["Sender"].(map[string]interface{}) message := Message{} - message.ID = string(int(msg["Id"].(float64))) + message.ID = strconv.Itoa(int(msg["Id"].(float64))) message.Subject = msg["Subject"].(string) message.Body = msg["Body"].(string) - message.FromID = string(int(sender["UserId"].(float64))) + message.FromID = strconv.Itoa(int(sender["UserId"].(float64))) message.FromName = sender["UserName"].(string) messages = append(messages, message) }