Skip to content

Commit e7da914

Browse files
DannyFelizrobfig
authored andcommitted
Fix syntax highlighting (#264)
1 parent ccba498 commit e7da914

1 file changed

Lines changed: 24 additions & 24 deletions

File tree

‎README.md‎

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
Cron V3 has been released!
77

88
To download the specific tagged release, run:
9-
10-
go get github.com/robfig/cron/[email protected]
11-
9+
```bash
10+
go get github.com/robfig/cron/[email protected]
11+
```
1212
Import it in your program as:
13-
14-
import "github.com/robfig/cron/v3"
15-
13+
```go
14+
import "github.com/robfig/cron/v3"
15+
```
1616
It requires Go 1.11 or later due to usage of Go Modules.
1717

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

6666
UPDATING: To retain the old behavior, construct your Cron with a custom
6767
parser:
68-
69-
// Seconds field, required
70-
cron.New(cron.WithSeconds())
71-
72-
// Seconds field, optional
73-
cron.New(
74-
cron.WithParser(
75-
cron.SecondOptional | cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor))
76-
68+
```go
69+
// Seconds field, required
70+
cron.New(cron.WithSeconds())
71+
72+
// Seconds field, optional
73+
cron.New(
74+
cron.WithParser(
75+
cron.SecondOptional | cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor))
76+
```
7777
- The Cron type now accepts functional options on construction rather than the
7878
previous ad-hoc behavior modification mechanisms (setting a field, calling a setter).
7979

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

9494
UPDATING: To opt into panic recovery and configure the panic logger:
95-
96-
cron.New(cron.WithChain(
97-
cron.Recover(logger), // or use cron.DefaultLogger
98-
))
99-
95+
```go
96+
cron.New(cron.WithChain(
97+
cron.Recover(logger), // or use cron.DefaultLogger
98+
))
99+
```
100100
- In adding support for https://github.com/go-logr/logr, `cron.WithVerboseLogger` was
101101
removed, since it is duplicative with the leveled logging.
102102

103103
UPDATING: Callers should use `WithLogger` and specify a logger that does not
104104
discard `Info` logs. For convenience, one is provided that wraps `*log.Logger`:
105-
106-
cron.New(
107-
cron.WithLogger(cron.VerbosePrintfLogger(logger)))
108-
105+
```go
106+
cron.New(
107+
cron.WithLogger(cron.VerbosePrintfLogger(logger)))
108+
```
109109

110110
### Background - Cron spec format
111111

0 commit comments

Comments
 (0)