File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ type Data struct {
29
29
footerTmpl * template.Template
30
30
mux sync.Mutex
31
31
wg sync.WaitGroup
32
+ err error
32
33
}
33
34
34
35
type table struct {
@@ -132,6 +133,9 @@ func (data *Data) Dump() error {
132
133
}
133
134
}
134
135
data .wg .Wait ()
136
+ if data .err != nil {
137
+ return data .err
138
+ }
135
139
136
140
// Set complete time
137
141
meta .CompleteTime = time .Now ().String ()
@@ -152,12 +156,14 @@ func (data *Data) dumpTable(name string) error {
152
156
return nil
153
157
}
154
158
155
- func (data * Data ) writeTable (table * table ) error {
159
+ func (data * Data ) writeTable (table * table ) {
156
160
data .mux .Lock ()
157
- err := data .tableTmpl .Execute (data .Out , table )
161
+ if err := data .tableTmpl .Execute (data .Out , table ); err != nil && data .err == nil {
162
+ data .err = err
163
+ }
158
164
data .mux .Unlock ()
159
165
data .wg .Done ()
160
- return err
166
+ return
161
167
}
162
168
163
169
// MARK: get methods
You can’t perform that action at this time.
0 commit comments