@ -112,6 +112,7 @@ func (iClient *InsightClient) GetTimeAllTimeEntriesForUserThroughDate(userId str
container := make ( [ ] * InsightTimeEntry , 0 , 1000 ) //do we want to make the default result size parametric?
container := make ( [ ] * InsightTimeEntry , 0 , 1000 ) //do we want to make the default result size parametric?
err := json . Unmarshal ( * rawBytes , & container )
err := json . Unmarshal ( * rawBytes , & container )
if err != nil {
if err != nil {
log . Printf ( "Error with following string: %s\n" , string ( * rawBytes ) )
log . Panic ( err )
log . Panic ( err )
}
}
returnChan <- & container
returnChan <- & container
@ -146,7 +147,6 @@ func (iClient *InsightClient) getRawUsers() *[]*InsightUser {
req := iClient . createRequest ( userEndpoint , insightTokenFile )
req := iClient . createRequest ( userEndpoint , insightTokenFile )
rawBytes := iClient . doGet ( req )
rawBytes := iClient . doGet ( req )
container := make ( [ ] * InsightUser , 0 , 150 ) //do we want to make the default result size parametric?
container := make ( [ ] * InsightUser , 0 , 150 ) //do we want to make the default result size parametric?
log . Println ( string ( * rawBytes ) )
err := json . Unmarshal ( * rawBytes , & container )
err := json . Unmarshal ( * rawBytes , & container )
if err != nil {
if err != nil {
log . Panic ( err )
log . Panic ( err )
@ -161,6 +161,10 @@ func (iClient *InsightClient) doGet(req *http.Request) *[]byte {
log . Panic ( err )
log . Panic ( err )
}
}
if resp . StatusCode != 200 {
log . Printf ( "Got non-200 response from request: %s\t%d" , req . URL , resp . StatusCode )
}
bodyBytes , err := ioutil . ReadAll ( resp . Body )
bodyBytes , err := ioutil . ReadAll ( resp . Body )
if err != nil {
if err != nil {
log . Panic ( err )
log . Panic ( err )