File tree Expand file tree Collapse file tree 2 files changed +4
-14
lines changed Expand file tree Collapse file tree 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 {
4646
4747func NewMessage (m core.QueuedMessage , opts ... Option ) * Message {
4848 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- }
5449
5550 return & Message {
5651 RetryCount : o .retryCount ,
@@ -62,11 +57,6 @@ func NewMessage(m core.QueuedMessage, opts ...Option) *Message {
6257
6358func NewTask (task TaskFunc , opts ... Option ) * Message {
6459 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- }
7060
7161 return & Message {
7262 Timeout : o .timeout ,
Original file line number Diff line number Diff line change @@ -10,14 +10,14 @@ type Options struct {
1010
1111// An Option configures a mutex.
1212type Option interface {
13- Apply (* Options )
13+ apply (* Options )
1414}
1515
1616// OptionFunc is a function that configures a job.
1717type OptionFunc func (* Options )
1818
19- // Apply calls f(option)
20- func (f OptionFunc ) Apply (option * Options ) {
19+ // apply calls f(option)
20+ func (f OptionFunc ) apply (option * Options ) {
2121 f (option )
2222}
2323
@@ -31,7 +31,7 @@ func NewOptions(opts ...Option) *Options {
3131 // Loop through each option
3232 for _ , opt := range opts {
3333 // Call the option giving the instantiated
34- opt .Apply (o )
34+ opt .apply (o )
3535 }
3636
3737 return o
You can’t perform that action at this time.
0 commit comments