Skip to content

Commit

Permalink
chore: rename WithLinkToDoc to WithRemediation
Browse files Browse the repository at this point in the history
  • Loading branch information
binbin-li committed Aug 6, 2024
1 parent 220dfce commit 51c5402
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions errors/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
6 changes: 3 additions & 3 deletions errors/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down

0 comments on commit 51c5402

Please sign in to comment.