(doc *pb.Document)
| 65 | } |
| 66 | |
| 67 | func getObjectFromDoc(doc *pb.Document) (*pb.Object, error) { |
| 68 | root := doc.GetRoot() |
| 69 | if root == nil { |
| 70 | return nil, fmt.Errorf("document '%s' does not have a root", doc.Name) |
| 71 | } |
| 72 | |
| 73 | obj := root.GetObject() |
| 74 | if obj == nil { |
| 75 | return nil, fmt.Errorf("root field of document '%s' does not have an object as it's value", doc.Name) |
| 76 | } |
| 77 | return obj, nil |
| 78 | } |
no test coverage detected