diff options
author | Martin Czygan <martin.czygan@gmail.com> | 2021-05-14 01:12:00 +0200 |
---|---|---|
committer | Martin Czygan <martin.czygan@gmail.com> | 2021-05-14 01:12:00 +0200 |
commit | 6b8f2f8d448cb3b89d8f7ad147e6a5eb1d3c4da9 (patch) | |
tree | 72ec6e2dedacdd47ae2e9d8579694cfd950bb553 /skate | |
parent | 50fbd0555d3533511de8b703ea67a9dc1f4bc415 (diff) | |
download | refcat-6b8f2f8d448cb3b89d8f7ad147e6a5eb1d3c4da9.tar.gz refcat-6b8f2f8d448cb3b89d8f7ad147e6a5eb1d3c4da9.zip |
cleanup: first occurance does not need to start at 0
Diffstat (limited to 'skate')
-rw-r--r-- | skate/url.go | 2 | ||||
-rw-r--r-- | skate/url_test.go | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/skate/url.go b/skate/url.go index d8560ac..b37fe4d 100644 --- a/skate/url.go +++ b/skate/url.go @@ -36,7 +36,7 @@ func SanitizeURL(s string) string { ) if len(indices) > 1 { // http://ailab.ist.psu.edu/bcpred/SVMTriP:http://sysbio.unl.edu/SVMTriP/prediction.phpBcell - s = s[0:indices[1]] // only use the first + s = s[indices[0]:indices[1]] // only use the first s = strings.TrimRight(s, ":") s = strings.TrimRight(s, ";") } diff --git a/skate/url_test.go b/skate/url_test.go index 1a439a6..8f50162 100644 --- a/skate/url_test.go +++ b/skate/url_test.go @@ -124,6 +124,7 @@ func TestSanitizeURL(t *testing.T) { {`http.worldbank.org/sq`, `http://worldbank.org/sq`}, {`httpwww.sun.com`, `http://www.sun.com`}, {`httpswww.unos.org`, `http://www.unos.org`}, + {`ics.uci.edu/pub/ietf/`, `http://ics.uci.edu/pub/ietf/`}, } for _, c := range cases { out := SanitizeURL(c.in) |