print readable variables with golang

后端 未结 6 542

How to print a map, struct or whatever in a readable way?

With PHP you can to this

echo \'
\';
print_r($var);
echo \'
\';

6条回答
  •  渐次进展
    2021-02-04 03:24

    https://github.com/davecgh/go-spew

    Go-spew implements a deep pretty printer for Go data structures to aid in debugging.

提交回复
热议问题