go-pretty

go-pretty: Utilities to prettify console output of tables, lists, progress-bars, text, etc. with a heavy emphasis on customization.

+-----+------------+-----------+--------+-----------------------------+
|   # | FIRST NAME | LAST NAME | SALARY |                             |
+-----+------------+-----------+--------+-----------------------------+
|   1 | Arya       | Stark     |   3000 |                             |
|  20 | Jon        | Snow      |   2000 | You know nothing, Jon Snow! |
| 300 | Tyrion     | Lannister |   5000 |                             |
+-----+------------+-----------+--------+-----------------------------+
|     |            | TOTAL     |  10000 |                             |
+-----+------------+-----------+--------+-----------------------------+

Execute go run github.com/jedib0t/go-pretty/v6/cmd/demo-table@latest colors to get:

Publikováno v Go