gitlab.com/evatix-go/core@v1.3.55/simplewrap/SquareWrapIf.go (about)

     1  package simplewrap
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"gitlab.com/evatix-go/core/constants"
     7  )
     8  
     9  func SquareWrapIf(
    10  	isSquareWrap bool,
    11  	source interface{},
    12  ) string {
    13  	if !isSquareWrap {
    14  		return fmt.Sprintf(
    15  			constants.SprintValueFormat,
    16  			source)
    17  	}
    18  
    19  	return fmt.Sprintf(
    20  		constants.SquareWrapFormat,
    21  		source)
    22  }