This application takes a single cron expression string as a command-line argument and prints out the expanded view of the given schedule.
go 1.14+
make
- Clone git repository to local machine
git clone https://github.com/sqrt-7/go-cronexp.git && cd go-cronexp
- Download dependencies
go mod download
- Compile application
make build
- Run with cron expression as the argument
./run_cronexp "*/15 0 1,15 * 1-5 /usr/bin/find"
- Expected output (example)
minute 0 15 30 45
hour 0
day of month 1 15
month 1 2 3 4 5 6 7 8 9 10 11 12
day of week 1 2 3 4 5
command /usr/bin/find
- Unit tests are located at
pkg/cronexp/cronexp_test.go
- Run unit tests:
make unit-test
- If the application has to be compiled for a specific os/architecture:
# For valid GOOS/GOARCH combinations run
go tool dist list
# Replace GOOS and GOARCH with the chosen values
GOOS=darwin GOARCH=amd64 go build -o ./run_cronexp ./cmd/cli/main.go