go-spew icon indicating copy to clipboard operation
go-spew copied to clipboard

feature request: add indexes for array elements

Open JFixby opened this issue 6 years ago • 0 comments

Example array: [5]int{14234, 42, -1, 1000, 5})

Current output:

([5]int) (len=5 cap=5) {
 (int) 14234,
 (int) 42,
 (int) -1,
 (int) 1000,
 (int) 5
}

Suggested output with index aligments:

<[1000]int> len=1000 cap=2000 {
        (0) <int> 14234
        (1) <int> 42
        (2) <int> -1
        ...           
      (998) <int> 1000
      (999) <int> 5
}

or

<[1000]int> len=1000 cap=2000 {
  (0) <int> 14234
  (1) <int> 42
  (2) <int> -1
        ...           
(998) <int> 1000
(999) <int> 5
}

Or smth like this. Anything that helps to see element index.

JFixby avatar Jul 20 '18 19:07 JFixby