-
Notifications
You must be signed in to change notification settings - Fork 56
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
Issues/34: More compact array/map representation #43
Closed
+114
−27
Closed
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
439e138
when dumping arrays and slices; always dump them in a compact form
komuw db5f024
add a temporary test
komuw 5f73c42
use a map in TestSdump_primitives instead of a []slice
komuw e882c5c
only compat arrays and slices of primitive types
komuw bc44f23
undo changes to tests
komuw 288fce3
update TestSdump_primitives
komuw 53cb262
fix all tests
komuw b4460aa
where the elements(not keys) of a map are primitive types; dump in a …
komuw c6e50e5
fix tests
komuw 1649d4c
add tests showing that maps with nonPrimitive elements are not compacted
komuw 42bf6d5
add tests showing that slices with nonPrimitive elements are not comp…
komuw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,29 @@ | ||
[]interface {}{ | ||
map[string]string{ | ||
"another string": "indeed", | ||
"hello": "there", | ||
"something": "something something", | ||
}, | ||
map[int]string{ | ||
1: "one", | ||
2: "two", | ||
3: "three", | ||
}, | ||
map[string]string{"another string":"indeed","hello":"there","something":"something something"}, | ||
map[int]string{1:"one",2:"two",3:"three"}, | ||
map[int]*litter_test.BlankStruct{ | ||
2: &litter_test.BlankStruct{}, | ||
}, | ||
map[string]litter_test.BasicStruct{ | ||
"five": litter_test.BasicStruct{ | ||
Public: 5, | ||
private: 5, | ||
}, | ||
"four": litter_test.BasicStruct{ | ||
Public: 4, | ||
private: 4, | ||
}, | ||
"one": litter_test.BasicStruct{ | ||
Public: 1, | ||
private: 1, | ||
}, | ||
"three": litter_test.BasicStruct{ | ||
Public: 3, | ||
private: 3, | ||
}, | ||
"two": litter_test.BasicStruct{ | ||
Public: 2, | ||
private: 2, | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,2 @@ | ||
[]string{ | ||
"x", | ||
"y", | ||
} | ||
[]string{"x","y"} | ||
42 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
[]string{ | ||
"x", | ||
"y", | ||
}42 | ||
[]string{"x","y"}42 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
[]string{ | ||
"x", | ||
"y", | ||
}***42 | ||
[]string{"x","y"}***42 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
[]interface {}{ | ||
[]string{"a","b","c","d","e","f"}, | ||
[15]int{1,2,3,4,5,6,7,8,78999,4,90000,0,0,0,0}, | ||
[]litter_test.BasicStruct{ | ||
litter_test.BasicStruct{ | ||
Public: 1, | ||
private: 1, | ||
}, | ||
litter_test.BasicStruct{ | ||
Public: 2, | ||
private: 2, | ||
}, | ||
litter_test.BasicStruct{ | ||
Public: 3, | ||
private: 3, | ||
}, | ||
}, | ||
[5]litter_test.BasicStruct{ | ||
litter_test.BasicStruct{ | ||
Public: 1, | ||
private: 1, | ||
}, | ||
litter_test.BasicStruct{ | ||
Public: 2, | ||
private: 2, | ||
}, | ||
litter_test.BasicStruct{ | ||
Public: 3, | ||
private: 3, | ||
}, | ||
litter_test.BasicStruct{ | ||
Public: 0, | ||
private: 0, | ||
}, | ||
litter_test.BasicStruct{ | ||
Public: 0, | ||
private: 0, | ||
}, | ||
}, | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should never mutate the configuration, which might be shared across multiple concurrent goroutines, and might be a constant at the caller's end. Let's add the flag to
dumpState
directly.