Skip to content

Commit b43d8ef

Browse files
authored
Merge pull request #42 from HeavyHorst/2123
removed unnecessary pointers
2 parents 888b717 + 753a59d commit b43d8ef

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

queues/nats/nats.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ type publisher interface {
2626

2727
// Transport is a vice.Transport for NATS queue.
2828
type Transport struct {
29-
*sync.Mutex
30-
wg *sync.WaitGroup
29+
sync.Mutex
30+
wg sync.WaitGroup
3131

3232
receiveChans map[string]chan []byte
3333
sendChans map[string]chan []byte
@@ -56,9 +56,6 @@ func New(opts ...Option) *Transport {
5656
}
5757

5858
return &Transport{
59-
Mutex: &sync.Mutex{},
60-
wg: &sync.WaitGroup{},
61-
6259
NatsAddr: DefaultAddr,
6360

6461
receiveChans: make(map[string]chan []byte),

queues/redis/redis.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ type Transport struct {
1414
sendChans map[string]chan []byte
1515
receiveChans map[string]chan []byte
1616

17-
*sync.Mutex
18-
wg *sync.WaitGroup
17+
sync.Mutex
18+
wg sync.WaitGroup
1919

2020
errChan chan error
2121
stopchan chan struct{}
@@ -35,8 +35,6 @@ func New(opts ...Option) *Transport {
3535
return &Transport{
3636
sendChans: make(map[string]chan []byte),
3737
receiveChans: make(map[string]chan []byte),
38-
Mutex: &sync.Mutex{},
39-
wg: &sync.WaitGroup{},
4038
errChan: make(chan error, 10),
4139
stopchan: make(chan struct{}),
4240
stopPubChan: make(chan struct{}),

queues/sqs/sqs.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import (
1414

1515
// Transport is a vice.Transport for Amazon's SQS
1616
type Transport struct {
17-
wg *sync.WaitGroup
18-
17+
wg sync.WaitGroup
18+
1919
sm sync.Mutex
2020
sendChans map[string]chan []byte
2121

@@ -33,7 +33,6 @@ type Transport struct {
3333
// New returns a new transport
3434
func New() *Transport {
3535
return &Transport{
36-
wg: &sync.WaitGroup{},
3736
sendChans: make(map[string]chan []byte),
3837
receiveChans: make(map[string]chan []byte),
3938
errChan: make(chan error, 10),

0 commit comments

Comments
 (0)