HasErrors returns true if any of the diagnostics in the list have a severity of Error.
()
| 121 | // HasErrors returns true if any of the diagnostics in the list have |
| 122 | // a severity of Error. |
| 123 | func (diags Diagnostics) HasErrors() bool { |
| 124 | for _, diag := range diags { |
| 125 | if diag.Severity() == Error { |
| 126 | return true |
| 127 | } |
| 128 | } |
| 129 | return false |
| 130 | } |
| 131 | |
| 132 | // ForRPC returns a version of the receiver that has been simplified so that |
| 133 | // it is friendly to RPC protocols. |