From cea0a82b49a0e18d3999ae81825fdbeea2fc6b5c Mon Sep 17 00:00:00 2001 From: chandiniv1 <117723967+chandiniv1@users.noreply.github.com> Date: Thu, 21 Dec 2023 03:37:21 +0530 Subject: [PATCH] Remove fmt.sprint() usage (#5403) * remove fmt.sprint() usuage * Update test code. --------- Co-authored-by: DimitrisJim Co-authored-by: Carlos Rodriguez --- modules/apps/27-interchain-accounts/types/port.go | 4 ++-- modules/apps/27-interchain-accounts/types/port_test.go | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/apps/27-interchain-accounts/types/port.go b/modules/apps/27-interchain-accounts/types/port.go index ee814279cf8..f845cf0cf5d 100644 --- a/modules/apps/27-interchain-accounts/types/port.go +++ b/modules/apps/27-interchain-accounts/types/port.go @@ -1,7 +1,6 @@ package types import ( - "fmt" "strings" errorsmod "cosmossdk.io/errors" @@ -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 } diff --git a/modules/apps/27-interchain-accounts/types/port_test.go b/modules/apps/27-interchain-accounts/types/port_test.go index 3b4aef8931a..372245f2779 100644 --- a/modules/apps/27-interchain-accounts/types/port_test.go +++ b/modules/apps/27-interchain-accounts/types/port_test.go @@ -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" ) @@ -22,7 +20,7 @@ func (suite *TypesTestSuite) TestNewControllerPortID() { { "success", func() {}, - fmt.Sprint(types.ControllerPortPrefix, TestOwnerAddress), + types.ControllerPortPrefix + TestOwnerAddress, true, }, {