Skip to content

Latest commit

 

History

History
35 lines (23 loc) · 1 KB

README.md

File metadata and controls

35 lines (23 loc) · 1 KB

https://github.com/zzwx/ifchanged

Ifchanged

Package ifchanged is a collection of Go functions to perform callbacks in case of file changes (using sha256 hash) and / or missing files.

Use case: Generating css file only if scss file has changed or css file is missing.

Example

err = ifchanged.NewIf().
    Changed(fileName, fileName+".sha256").
    Missing("somefile.txt").
    Execute(func() error {
        fmt.Printf("This has been called because \"somefile.txt\" is missing or %v has changed\n", fileName)
        return nil
    })

Doc

pkg.go.dev/github.com/zzwx/ifchanged

Dependencies

  • go 1.13

DB

ifchanged, additionally, has a way to provide checksums using a DB interface.