File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 4
4
"math/rand"
5
5
6
6
amqp "github.com/rabbitmq/amqp091-go"
7
+
7
8
"github.com/wagslane/go-rabbitmq/internal/connectionmanager"
8
9
)
9
10
@@ -26,16 +27,16 @@ type Config amqp.Config
26
27
type Resolver = connectionmanager.Resolver
27
28
28
29
type StaticResolver struct {
29
- urls []string
30
- shuffe bool
30
+ urls []string
31
+ shuffle bool
31
32
}
32
33
33
34
func (r * StaticResolver ) Resolve () ([]string , error ) {
34
35
// TODO: move to slices.Clone when supported Go versions > 1.21
35
36
var urls []string
36
37
urls = append (urls , r .urls ... )
37
38
38
- if r .shuffe {
39
+ if r .shuffle {
39
40
rand .Shuffle (len (urls ), func (i , j int ) {
40
41
urls [i ], urls [j ] = urls [j ], urls [i ]
41
42
})
@@ -44,7 +45,7 @@ func (r *StaticResolver) Resolve() ([]string, error) {
44
45
}
45
46
46
47
func NewStaticResolver (urls []string , shuffle bool ) * StaticResolver {
47
- return & StaticResolver {urls : urls }
48
+ return & StaticResolver {urls : urls , shuffle : shuffle }
48
49
}
49
50
50
51
// NewConn creates a new connection manager
You can’t perform that action at this time.
0 commit comments