From 51c5402b16b619867c92dcf15789f2d91cbc11aa Mon Sep 17 00:00:00 2001 From: Binbin Li Date: Tue, 6 Aug 2024 13:07:26 +0000 Subject: [PATCH] chore: rename WithLinkToDoc to WithRemediation --- errors/types.go | 4 ++-- errors/types_test.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/errors/types.go b/errors/types.go index a203a8000..cb5e0311b 100644 --- a/errors/types.go +++ b/errors/types.go @@ -151,8 +151,8 @@ func (ec ErrorCode) WithComponentType(componentType ComponentType) Error { return newError(ec, ec.Message()).WithComponentType(componentType) } -// WithLinkToDoc returns a new Error object with attached link to the documentation. -func (ec ErrorCode) WithLinkToDoc(link string) Error { +// WithRemediation returns a new Error object with remediation. +func (ec ErrorCode) WithRemediation(link string) Error { return newError(ec, ec.Message()).WithRemediation(link) } diff --git a/errors/types_test.go b/errors/types_test.go index 0929c4a85..a1f66e388 100644 --- a/errors/types_test.go +++ b/errors/types_test.go @@ -118,10 +118,10 @@ func TestWithComponentType(t *testing.T) { } } -func TestWithLinkToDoc(t *testing.T) { - err := testEC.WithLinkToDoc(testLink1) +func TestWithRemediation(t *testing.T) { + err := testEC.WithRemediation(testLink1) if err.remediation != testLink1 { - t.Fatalf("expected link to doc: %s, got: %s", testLink1, err.remediation) + t.Fatalf("expected remediation: %s, got: %s", testLink1, err.remediation) } }