Commits

Sergio Tulentsev  committed 481eb5f

Add more nil checks. Remove unused code.

  • Participants
  • Parent commits b255966

Comments (0)

Files changed (1)

File stackexchange.go

 
 	// Build URL parameters
 	vals := params.values()
-	if c.AccessToken != "" {
+	if c != nil && c.AccessToken != "" {
 		vals.Set("access_token", c.AccessToken)
 	}
-	if c.Key != "" {
+	if c != nil && c.Key != "" {
 		vals.Set("key", c.Key)
 	}
 
 	return string(buf)
 }
 
-// JoinIDs builds a string of semicolon-separated IDs.
-func JoinIDs(ids []int) string {
-	const bytesPerID = 9
-	buf := make([]byte, 0, bytesPerID*len(ids))
-	for _, id := range ids {
-		if len(buf) > 0 {
-			buf = append(buf, ';')
-		}
-		buf = strconv.AppendInt(buf, int64(id), 10)
-	}
-	return string(buf)
-}
-
 func parseResponse(r io.Reader, v interface{}) (*Wrapper, error) {
 	var result struct {
 		Items items `json:"items"`