code: func parseListing(t *thing) ([]*Comment, []*Post, []*Message, error) {
  	if t.Kind != listingKind {
  		return nil, nil, nil, fmt.Errorf("thing is not listing")
  	}
  
  	l := &listing{}
  	if err := mapstructure.Decode(t.Data, l); err != nil {
  		return nil, nil, nil, mapDecodeError(err, t.Data)
  	}
  
  	comments := []*Comment{}
  	posts := []*Post{}
  	msgs := []*Message{}
  	err := error(nil)
  
  	for _, c := range l.Children {
  		if err != nil {
  			break
  		}
  
  		var comment *Comment
  		var post *Post
  		var msg *Message
  
  		// Reddit sets the "Kind" field of comments in the inbox, which
  		// have only Message and not Comment fields, to commentKind. The
  		// give away in this case is that comments in message form have
  		// a field called "was_comment". Reddit does this because they
  		// hate programmers.
  		if c.Kind == messageKind || c.Data["was_comment"] != nil {
  			msg, err = parseMessage(&c)
  			msgs = append(msgs, msg)
  		} else if c.Kind == commentKind {
  			comment, err = parseComment(&c)
  			comments = append(comments, comment)
  		} else if c.Kind == postKind {
  			post, err = parsePost(&c)
  			posts = append(posts, post)
  		}
  	}
  
  	return comments, posts, msgs, err
  }
docs: // parseListing parses a Reddit listing type and returns the elements inside it.