예제 #1
0
func (s *DBService) SaveResult(newResult models.Result) (models.Result, error) {

	// Add an Id
	newResult.Id = bson.NewObjectId()
	s.session.DB("goExample").C("result").Insert(newResult)
	return newResult, nil

}
func (s *ExampleService) GetData(result models.Result) (models.Result, error) {
	/* do something neat */
	result.Data = "Lorem Ipsum"
	return result, nil
}