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

      

Career choice: Learn skills to mitigate the upcoming AI privacy disaster*

Join 800+ devs reading my newsletter

*Everyone and their mother is sending sensitive data to AI systems with little concern for their privacy. If you read the fineprint, vendors and platforms actually offer very little guarantees. It's a matter of time before it goes wrong.

From March 2026 onwards, I'll be writing about development of verifiably-secure services using OpenPCC.

Avatar of the author
Willem Schots