Skip to content
Node: node-crongithub.com/sahilkhaire/gox/cron

Parse

Overview ​

Parse validates a cron expression (with optional seconds field).

Part of the cron package — Node.js analog: node-cron.

Signature ​

go
func Parse(expr string) error

Compare: Node.js · Standard Go · gox ​

js
// Typical node-cron pattern in Node.js
go
c := cron.New()
c.AddFunc(spec, fn)
c.Start()
go
import "github.com/sahilkhaire/gox/cron"

spec, err := cron.Parse("0 * * * *")

Example ​

go
import "github.com/sahilkhaire/gox/cron"

spec, err := cron.Parse("0 * * * *")

Tips ​

Import github.com/sahilkhaire/gox/cron and call Parse directly. See the comparison below for the standard library equivalent.

Standard library alternative ​

Use the standard library directly:

go
c := cron.New()
c.AddFunc(spec, fn)
c.Start()

← Back to cron package overview

MIT Licensed · Built for Node.js developers moving to Go