Skip to content

Commit

Permalink
Fix syntax highlighting (robfig#264)
Browse files Browse the repository at this point in the history
  • Loading branch information
DannyFeliz authored and robfig committed Jan 4, 2020
1 parent ccba498 commit e7da914
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
Cron V3 has been released!

To download the specific tagged release, run:

go get github.com/robfig/cron/[email protected]

```bash
go get github.com/robfig/cron/[email protected]
```
Import it in your program as:

import "github.com/robfig/cron/v3"

```go
import "github.com/robfig/cron/v3"
```
It requires Go 1.11 or later due to usage of Go Modules.

Refer to the documentation here:
Expand Down Expand Up @@ -65,15 +65,15 @@ It is backwards incompatible with both v1 and v2. These updates are required:

UPDATING: To retain the old behavior, construct your Cron with a custom
parser:

// Seconds field, required
cron.New(cron.WithSeconds())

// Seconds field, optional
cron.New(
cron.WithParser(
cron.SecondOptional | cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor))

```go
// Seconds field, required
cron.New(cron.WithSeconds())

// Seconds field, optional
cron.New(
cron.WithParser(
cron.SecondOptional | cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor))
```
- The Cron type now accepts functional options on construction rather than the
previous ad-hoc behavior modification mechanisms (setting a field, calling a setter).

Expand All @@ -92,20 +92,20 @@ It is backwards incompatible with both v1 and v2. These updates are required:
has been removed to accommodate the more general JobWrapper type.

UPDATING: To opt into panic recovery and configure the panic logger:

cron.New(cron.WithChain(
cron.Recover(logger), // or use cron.DefaultLogger
))

```go
cron.New(cron.WithChain(
cron.Recover(logger), // or use cron.DefaultLogger
))
```
- In adding support for https://github.com/go-logr/logr, `cron.WithVerboseLogger` was
removed, since it is duplicative with the leveled logging.

UPDATING: Callers should use `WithLogger` and specify a logger that does not
discard `Info` logs. For convenience, one is provided that wraps `*log.Logger`:

cron.New(
cron.WithLogger(cron.VerbosePrintfLogger(logger)))

```go
cron.New(
cron.WithLogger(cron.VerbosePrintfLogger(logger)))
```

### Background - Cron spec format

Expand Down

0 comments on commit e7da914

Please sign in to comment.