(data map[string]string)
| 181 | } |
| 182 | |
| 183 | func structToHTML(data map[string]string) (string, error) { |
| 184 | style := ` |
| 185 | <style type="text/css"> |
| 186 | .tg {border-collapse:collapse;border-spacing:0;} |
| 187 | .tg td{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px; |
| 188 | overflow:hidden;padding:10px 5px;word-break:normal;} |
| 189 | .tg th{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px; |
| 190 | font-weight:normal;overflow:hidden;padding:10px 5px;word-break:normal;} |
| 191 | .tg .tg-0lax{text-align:left;vertical-align:top} |
| 192 | </style>` |
| 193 | html := ` |
| 194 | <table class="tg"> |
| 195 | <thead> |
| 196 | <tr> |
| 197 | <th class="tg-0lax">key</th> |
| 198 | <th class="tg-0lax">value</th> |
| 199 | </tr> |
| 200 | </thead> |
| 201 | |
| 202 | <tbody>` |
| 203 | |
| 204 | for key, value := range data { |
| 205 | html += fmt.Sprintf(` |
| 206 | <tr> |
| 207 | <td class="tg-0lax">%s</td> |
| 208 | <td class="tg-0lax">%s<br></td> |
| 209 | </tr>`, key, value) |
| 210 | } |
| 211 | |
| 212 | html += ` |
| 213 | </tbody> |
| 214 | </table> |
| 215 | ` |
| 216 | |
| 217 | return style + html, nil |
| 218 | } |
| 219 | |
| 220 | func main() { |
| 221 | loadConfig() |
no outgoing calls
no test coverage detected