Skip to content

Commit

Permalink
Remove fmt.sprint() usage (cosmos#5403)
Browse files Browse the repository at this point in the history
* remove fmt.sprint() usuage

* Update test code.

---------

Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>
Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
  • Loading branch information
3 people committed Dec 20, 2023
1 parent 335e4ff commit cea0a82
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions modules/apps/27-interchain-accounts/types/port.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package types

import (
"fmt"
"strings"

errorsmod "cosmossdk.io/errors"
Expand All @@ -13,5 +12,6 @@ func NewControllerPortID(owner string) (string, error) {
return "", errorsmod.Wrap(ErrInvalidAccountAddress, "owner address cannot be empty")
}

return fmt.Sprint(ControllerPortPrefix, owner), nil
ownerWithPrefix := ControllerPortPrefix + owner
return ownerWithPrefix, nil
}
4 changes: 1 addition & 3 deletions modules/apps/27-interchain-accounts/types/port_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package types_test

import (
"fmt"

"github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types"
ibctesting "github.com/cosmos/ibc-go/v8/testing"
)
Expand All @@ -22,7 +20,7 @@ func (suite *TypesTestSuite) TestNewControllerPortID() {
{
"success",
func() {},
fmt.Sprint(types.ControllerPortPrefix, TestOwnerAddress),
types.ControllerPortPrefix + TestOwnerAddress,
true,
},
{
Expand Down

0 comments on commit cea0a82

Please sign in to comment.