@@ -87,10 +87,13 @@ func bindingPath() string {
8787}
8888
8989func bindingPathWithExchangeQueueKey (exchangeSpec IExchangeSpecification , queueSpec IQueueSpecification , key string ) string {
90- //string path =
91- //$"/{Consts.Bindings}/src={Utils.EncodePathSegment(_sourceName)};{($"{destinationCharacter}={Utils.EncodePathSegment(_destinationName)};key={Utils.EncodePathSegment(_routingKey)};args=")}";
92-
93- return fmt .Sprintf ("/%s/src=%s;dstq=%s;key=%s;args=" , Bindings , encodePathSegments (exchangeSpec .GetName ()), encodePathSegments (queueSpec .GetName ()), encodePathSegments (key ))
90+ exchangeName := exchangeSpec .GetName ()
91+ exchangeNameEncoded := encodePathSegments (exchangeName )
92+ queueName := queueSpec .GetName ()
93+ queueNameEncoded := encodePathSegments (queueName )
94+ keyEncoded := encodePathSegments (key )
95+ format := "/%s/src=%s;dstq=%s;key=%s;args="
96+ return fmt .Sprintf (format , Bindings , exchangeNameEncoded , queueNameEncoded , keyEncoded )
9497
9598}
9699
@@ -107,15 +110,13 @@ func GenerateNameWithDefaultPrefix() string {
107110
108111// GenerateName generates a unique name with the given prefix
109112func GenerateName (prefix string ) string {
110-
111- var uid = uuid .New ()
112- var uuidBytes = []byte (uid .String ())
113- var _md5 = md5 .New ()
114- var digest = _md5 .Sum (uuidBytes )
113+ uid := uuid .New ()
114+ uuidBytes := []byte (uid .String ())
115+ md5obj := md5 .New ()
116+ digest := md5obj .Sum (uuidBytes )
115117 result := base64 .StdEncoding .EncodeToString (digest )
116118 result = strings .ReplaceAll (result , "+" , "-" )
117119 result = strings .ReplaceAll (result , "/" , "_" )
118120 result = strings .ReplaceAll (result , "=" , "" )
119121 return prefix + result
120-
121122}
0 commit comments