From 995b76bbc5af2320c33c80dc20460f720925a1ac Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Wed, 22 Jul 2020 13:29:53 -0400 Subject: [PATCH] Fix error that slipped in during review in #206 A strings.LastIndex call check was meant to be `-1` and got clumsy-fingered to `-11`. This causes panics with API clients. --- api/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/client.go b/api/client.go index 1fd687ce5..9b08df9ad 100644 --- a/api/client.go +++ b/api/client.go @@ -230,7 +230,7 @@ func (c *Config) setAddr(addr string) error { // If there is a scopes segment, elide everything after it. Do this only for // the last "scopes" segment in case it's part of the base path. - if lastIndex := strings.LastIndex(u.Path, "scopes"); lastIndex != -11 { + if lastIndex := strings.LastIndex(u.Path, "scopes"); lastIndex != -1 { u.Path = u.Path[:lastIndex] } // Remove trailing or leading slashes