Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More compact array representation #34

Open
atombender opened this issue Oct 22, 2019 · 3 comments
Open

More compact array representation #34

atombender opened this issue Oct 22, 2019 · 3 comments

Comments

@atombender
Copy link
Member

This gets old fast:

       Source: &json.RawMessage{
          123,
          34,
          97,
          103,
          101,
          110,
          116,
          95,
          117,
          105,
          100,
          34,
...

We should emit arrays in a compact way for primitive types such as bytes.

@komuw
Copy link
Contributor

komuw commented May 20, 2021

I would also add something besides compactness; for arrays & slices we should show only the first N items.

for example, delve(the debugger) does this:

(dlv) p mySlice

[]int len: 10000, cap: 12288, [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,...+9936 more]

@atombender
Copy link
Member Author

True. The goal with Litter is to give an accurate representation of all the data, but I guess this could be a configuration option.

@komuw
Copy link
Contributor

komuw commented May 20, 2021

regarding compactness, should it also apply to arrays/slices that are inside other types?

type House struct {
	Name   string
	Chairs []string // Should this be compacted?
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants