()
| 98 | func (p sortedStructs) Sort() { sort.Sort(p) } |
| 99 | |
| 100 | func (i *Inception) generateCode() error { |
| 101 | // We sort the structs by name, so output if predictable. |
| 102 | sorted := sortedStructs(i.objs) |
| 103 | sorted.Sort() |
| 104 | |
| 105 | for _, si := range sorted { |
| 106 | if i.wantMarshal(si) { |
| 107 | err := CreateMarshalJSON(i, si) |
| 108 | if err != nil { |
| 109 | return err |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | if i.wantUnmarshal(si) { |
| 114 | err := CreateUnmarshalJSON(i, si) |
| 115 | if err != nil { |
| 116 | return err |
| 117 | } |
| 118 | } |
| 119 | } |
| 120 | return nil |
| 121 | } |
| 122 | |
| 123 | func (i *Inception) handleError(err error) { |
| 124 | fmt.Fprintf(os.Stderr, "Error: %s:\n\n", err) |
no test coverage detected