bradleyjkemp / memviz

Visualize your Go data structures using graphviz
MIT License
1.3k stars 51 forks source link

Add basic string escaping #31

Closed bradleyjkemp closed 5 years ago

bradleyjkemp commented 6 years ago

Fixes #29

piotrkowalczuk commented 5 years ago

@bradleyjkemp I would love to see this change being merged into master.

coveralls commented 5 years ago

Pull Request Test Coverage Report for Build 83


Changes Missing Coverage Covered Lines Changed/Added Lines %
collections.go 5 8 62.5%
<!-- Total: 8 11 72.73% -->
Totals Coverage Status
Change from base Build 75: 0.2%
Covered Lines: 228
Relevant Lines: 256

💛 - Coveralls
bradleyjkemp commented 5 years ago

Hey @piotrkowalczuk, thanks for the prod about this. Could you let me know if this fixes the problems you were encountering?

piotrkowalczuk commented 5 years ago

@bradleyjkemp Thanks for quick response!

My output looks like Error: bad label format <name> task |{<f0> name | "generate-beggining"} |<f1> anchor|{<f2> err | error(nil)} |{<f3> result | interface {}(nil)}

Currently I have small hack for it. After passing it through strings.Replace(buf.String(), "interface {}(nil)", "interface(nil)", -1). cat /tmp/memviz.dot | dot -Tpng -o /tmp/memviz.png produces valid image.

bradleyjkemp commented 5 years ago

Ah yes, good point: found a missing escapeString() call. PR #35 should fix your issue.

If not then a small example of a datastructure that causes this failure would be very useful.