AddToDebugInfo adds compatibility data to the given debug.Info.
(di *debug.Info)
| 8 | |
| 9 | // AddToDebugInfo adds compatibility data to the given debug.Info. |
| 10 | func AddToDebugInfo(di *debug.Info) { |
| 11 | // Get iptables state and add error info if it fails. |
| 12 | chains, err := GetIPTablesChains() |
| 13 | if err != nil { |
| 14 | di.AddSection( |
| 15 | "Compatibility: IPTables Chains (failed)", |
| 16 | debug.UseCodeSection, |
| 17 | err.Error(), |
| 18 | ) |
| 19 | return |
| 20 | } |
| 21 | |
| 22 | // Add data as section. |
| 23 | di.AddSection( |
| 24 | fmt.Sprintf("Compatibility: IPTables Chains (%d)", len(chains)-10), |
| 25 | debug.UseCodeSection|debug.AddContentLineBreaks, |
| 26 | chains..., |
| 27 | ) |
| 28 | } |
nothing calls this directly
no test coverage detected