77
87
// Machine returns the machine with the given id.
78
88
func (s *State) Machine(id int) (*Machine, error) {
80
sel := bson.D{{"_id", id}, {"life", Alive}}
81
91
err := s.machines.Find(sel).One(mdoc)
83
93
return nil, fmt.Errorf("cannot get machine %d: %v", id, err)