Conversation
| "strconv" | ||
| "strings" | ||
|
|
||
| "github.com/scylladb/go-set/strset" |
Contributor
There was a problem hiding this comment.
Can we avoid introducing a new external package?
Can we simply use map[string]struct{}?
Collaborator
Author
There was a problem hiding this comment.
We could, but if we did I would be copy-pasting significant part of of that package anyway, so I don't think it would be better.
Contributor
There was a problem hiding this comment.
Let's not introduce external dependencies to chi core package, unless necessary.
| func TestParseHeaderList(t *testing.T) { | ||
| h := parseHeaderList("header, second-header, THIRD-HEADER, Numb3r3d-H34d3r, Header_with_underscore Header.with.full.stop") | ||
| e := []string{"Header", "Second-Header", "Third-Header", "Numb3r3d-H34d3r", "Header_with_underscore", "Header.with.full.stop"} | ||
| if h[0] != e[0] || h[1] != e[1] || h[2] != e[2] || h[3] != e[3] || h[4] != e[4] || h[5] != e[5] { |
Contributor
There was a problem hiding this comment.
slices.Equal or maps.Equal will do
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Uh oh!
There was an error while loading. Please reload this page.