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

Make user-supplied sinks operate on URIs #606

Merged
merged 6 commits into from
Jul 19, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clean up normalizeScheme
  • Loading branch information
akshayjshah committed Jul 13, 2018
commit 8dccd5cd061c306752d1881c3e16a8524bc6f622
5 changes: 1 addition & 4 deletions sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,6 @@ func normalizeScheme(s string) (string, error) {
if first := s[0]; 'a' > first || 'z' < first {
return "", errors.New("must start with a letter")
}
if len(s) < 2 {
return s, nil
}
for i := 1; i < len(s); i++ { // iterate over bytes, not runes
c := s[i]
switch {
Expand All @@ -158,7 +155,7 @@ func normalizeScheme(s string) (string, error) {
case c == '.' || c == '+' || c == '-':
continue
}
return "", fmt.Errorf("may not contain %q", string(c))
return "", fmt.Errorf("may not contain %q", c)
}
return s, nil
}