aboutsummaryrefslogtreecommitdiff
path: root/rutina.go
diff options
context:
space:
mode:
authorAlexander Kiryukhin <alexander@kiryukhin.su>2019-01-17 07:57:51 +0300
committerAlexander Kiryukhin <alexander@kiryukhin.su>2019-01-17 07:57:51 +0300
commit11a32ca219905f7c42698b55b6af9920626b7b51 (patch)
treecab1f8033067111f6214a4b642750ad00147d3de /rutina.go
parentc5776ba6a3d8303650208ee8abc8f63cadf5127a (diff)
Remove context from constructorv0.2.1
Diffstat (limited to 'rutina.go')
-rwxr-xr-xrutina.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/rutina.go b/rutina.go
index 2a28682..8a8cccc 100755
--- a/rutina.go
+++ b/rutina.go
@@ -22,11 +22,11 @@ type Rutina struct {
}
// New instance with builtin context
-func New(opts ...Option) (*Rutina, context.Context) {
+func New(opts ...Option) *Rutina {
ctx, cancel := context.WithCancel(context.Background())
var counter uint64 = 0
r := &Rutina{ctx: ctx, Cancel: cancel, counter: &counter, cancelByError: false}
- return r.WithOptions(opts...), ctx
+ return r.WithOptions(opts...)
}
func (r *Rutina) WithOptions(opts ...Option) *Rutina {