Skip to content

Commit

Permalink
fix(endpoint): fix endpoint.SecurityString
Browse files Browse the repository at this point in the history
  • Loading branch information
saitofun committed Jul 9, 2024
1 parent 124e197 commit 3c843a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strconv"
"strings"

"github.com/pkg/errors"
"github.com/xoctopus/x/misc/must"
"github.com/xoctopus/x/reflectx"
"github.com/xoctopus/x/textx"
)
Expand Down Expand Up @@ -45,14 +45,14 @@ func (e Endpoint) String() string {
}

s, err := url.QueryUnescape(u.String())
if err != nil {
panic(errors.Wrapf(err, "failed to query unescape: %s", u.String()))
}
must.NoErrorWrap(err, "failed to query unescape: %s", u.String())
return s
}

func (e Endpoint) SecurityString() string {
e.Password = Password(e.Password.SecurityString())
if e.Password != "" {
e.Password = Password(e.Password.SecurityString())
}
return e.String()
}

Expand Down
1 change: 1 addition & 0 deletions endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ func TestEndpoint(t *testing.T) {

t.Run("SecurityString", func(t *testing.T) {
t.Log(cases["Postgres"].ep.SecurityString())
t.Log(cases["STMPs"].ep.SecurityString())
})

t.Run("IsZero", func(t *testing.T) {
Expand Down

0 comments on commit 3c843a1

Please sign in to comment.