Commit be12cce
committed
specerror: Add FilterError helper
This doesn't save much time for folks who are iterating over the
removed errors (e.g. to print warnings about them), but Aleksa asked
for it [1].
I haven't used it in runtimetest. I'm waiting for the in-flight
7aa3987 (cmd/runtimetest/main: Use TAP diagnostics for errors,
2017-07-28, #439) to settle, since that commit cleans up some of the
runtimetest error-processing code with:
validations := defaultValidations
if platform == "linux" {
validations = append(validations, linuxValidations...)
}
and a single loop over the constructed validations array.
I initially had FilterError returning (filtered, removed), but golint
didn't like that:
error should be the last type when returning multiple items
[1]: #492 (comment)
Signed-off-by: W. Trevor King <wking@tremily.us>1 parent a9dbd7e commit be12cce
2 files changed
+23
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
48 | 42 | | |
49 | | - | |
50 | 43 | | |
51 | | - | |
52 | 44 | | |
53 | | - | |
| 45 | + | |
54 | 46 | | |
55 | 47 | | |
56 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
0 commit comments