diff --git a/pkg/sources/openbgpd/config.go b/pkg/sources/openbgpd/config.go index 5e62b4d..a7ea0f1 100644 --- a/pkg/sources/openbgpd/config.go +++ b/pkg/sources/openbgpd/config.go @@ -23,10 +23,7 @@ type Config struct { // APIURL creates an url from the config func (cfg *Config) APIURL(path string, params ...interface{}) string { - u := cfg.API - if strings.HasSuffix(u, "/") { - u = u[:len(u)-1] - } + u := strings.TrimSuffix(cfg.API, "/") u += fmt.Sprintf(path, params...) return u }