diff --git a/README.md b/README.md index 8589a3f..69ba9c9 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ import ( ) func main() { - ctx, cancel := context.WithTimeout(context.Background(), time.Second*5) + ctx, cancel := context.WithCancel(context.Background()) defer cancel() s := schedule.New() diff --git a/Taskfile.yml b/Taskfile.yml new file mode 100644 index 0000000..03333f5 --- /dev/null +++ b/Taskfile.yml @@ -0,0 +1,18 @@ +version: 3 + +tasks: + test: + cmds: + - go test -v -race ./... + + lint:docker: + cmds: + - docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.54.0 golangci-lint run -v + + lint: + cmds: + - golangci-lint run + + lint:fix: + cmds: + - golangci-lint run --fix \ No newline at end of file diff --git a/examples/main.go b/examples/main.go index b29bf0e..480d303 100644 --- a/examples/main.go +++ b/examples/main.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/flowck/schedule" + "github.com/flowck/schedule/schedule" ) func main() { diff --git a/job.go b/schedule/job.go similarity index 100% rename from job.go rename to schedule/job.go diff --git a/logger.go b/schedule/logger.go similarity index 100% rename from logger.go rename to schedule/logger.go diff --git a/schedule.go b/schedule/schedule.go similarity index 100% rename from schedule.go rename to schedule/schedule.go diff --git a/schedule_test.go b/schedule/schedule_test.go similarity index 97% rename from schedule_test.go rename to schedule/schedule_test.go index dfce4b0..22b7317 100644 --- a/schedule_test.go +++ b/schedule/schedule_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/flowck/schedule" + "github.com/flowck/schedule/schedule" ) func TestSchedule(t *testing.T) {