Review this Go function that builds a slice of ids from a large result set. It shows up high in allocation profiles.