File tree 2 files changed +4
-14
lines changed
2 files changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -46,11 +46,6 @@ func (m *Message) Encode() []byte {
46
46
47
47
func NewMessage (m core.QueuedMessage , opts ... Option ) * Message {
48
48
o := NewOptions (opts ... )
49
- // Loop through each option
50
- for _ , opt := range opts {
51
- // Call the option giving the instantiated
52
- opt .Apply (o )
53
- }
54
49
55
50
return & Message {
56
51
RetryCount : o .retryCount ,
@@ -62,11 +57,6 @@ func NewMessage(m core.QueuedMessage, opts ...Option) *Message {
62
57
63
58
func NewTask (task TaskFunc , opts ... Option ) * Message {
64
59
o := NewOptions (opts ... )
65
- // Loop through each option
66
- for _ , opt := range opts {
67
- // Call the option giving the instantiated
68
- opt .Apply (o )
69
- }
70
60
71
61
return & Message {
72
62
Timeout : o .timeout ,
Original file line number Diff line number Diff line change @@ -10,14 +10,14 @@ type Options struct {
10
10
11
11
// An Option configures a mutex.
12
12
type Option interface {
13
- Apply (* Options )
13
+ apply (* Options )
14
14
}
15
15
16
16
// OptionFunc is a function that configures a job.
17
17
type OptionFunc func (* Options )
18
18
19
- // Apply calls f(option)
20
- func (f OptionFunc ) Apply (option * Options ) {
19
+ // apply calls f(option)
20
+ func (f OptionFunc ) apply (option * Options ) {
21
21
f (option )
22
22
}
23
23
@@ -31,7 +31,7 @@ func NewOptions(opts ...Option) *Options {
31
31
// Loop through each option
32
32
for _ , opt := range opts {
33
33
// Call the option giving the instantiated
34
- opt .Apply (o )
34
+ opt .apply (o )
35
35
}
36
36
37
37
return o
You can’t perform that action at this time.
0 commit comments