lxc/go-lxc — pull request #4 by fatih (2014-02-22 08:57:02+00:00)
Title: container: change XxxContainers() return behaviour

I didn't know whether to open or not. You might have your reasons to do things differently but I'll give a shot.

Problems:

1. Previously when a NewContainer() creating fails the whole
process would return a nil. That would be not acceptable for large
number of containers. I.e: if we had 100 containers, one buggy
container retrieval would cause to not get the rest 99 containers.

2. A list of values is prepared by dereferencing a container type and
appending it to a []Container slice. However this again is not much
usable, because first it will take more space, second all of the
methods defined on the "Container" struct are based on pointer receiver
instead of a value receiver. Therefore one had to take the pointer of
the returned value to get access to the available methods.

Solution:

1. Return all successful retrieved containers and silently fail for
failing containers.

2. Return a slice of pointer to containers instead of a slice of value of containers.