Visualize Go slices and arrays

Expore the connection between slices and arrays by generating diagrams from Go code.

  1. 1
    Play with the code in the editor below.
  2. 2
    Pass arrays and slices to the Visualize function.
    The signature of this function looks like Visualize(vals ...any). The values must be slices or pointers to arrays.
  3. 3
    Click the visualize button to update the diagram.
editor

Options

output

      

It's getting crazy out there*
Let's cool down a bit?

Join 800+ icecold subscribers

*Political, social and economical trust keeps eroding. AI is adding non-deterministic fuel to the fire.

I'm currently building attested.systems, a way to make systems verifiable by humans and machines. Sharing what I learn along the way.

Avatar of the author
Willem Schots
Edvard Munch, Public domain, via Wikimedia Commons