From 1545842704dc00ce8e03ce64a0f85b4d03129cd7 Mon Sep 17 00:00:00 2001 From: Brian Brazil Date: Mon, 9 Oct 2017 16:57:05 +0100 Subject: [PATCH] TrimPrefix removes a prefix, TrimLeft removes chars --- retrieval/target_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retrieval/target_test.go b/retrieval/target_test.go index 6a872189a..7e53fe1ed 100644 --- a/retrieval/target_test.go +++ b/retrieval/target_test.go @@ -128,7 +128,7 @@ func TestTargetURL(t *testing.T) { func newTestTarget(targetURL string, deadline time.Duration, lbls labels.Labels) *Target { lb := labels.NewBuilder(lbls) lb.Set(model.SchemeLabel, "http") - lb.Set(model.AddressLabel, strings.TrimLeft(targetURL, "http://")) + lb.Set(model.AddressLabel, strings.TrimPrefix(targetURL, "http://")) lb.Set(model.MetricsPathLabel, "/metrics") return &Target{labels: lb.Labels()}