mirror of
https://github.com/go-task/task.git
synced 2024-12-14 10:52:43 +02:00
17 lines
388 B
Go
17 lines
388 B
Go
|
package fingerprint
|
||
|
|
||
|
import "fmt"
|
||
|
|
||
|
func NewSourcesChecker(method, tempDir string, dry bool) (SourcesCheckable, error) {
|
||
|
switch method {
|
||
|
case "timestamp":
|
||
|
return NewTimestampChecker(tempDir, dry), nil
|
||
|
case "checksum":
|
||
|
return NewChecksumChecker(tempDir, dry), nil
|
||
|
case "none":
|
||
|
return NoneChecker{}, nil
|
||
|
default:
|
||
|
return nil, fmt.Errorf(`task: invalid method "%s"`, method)
|
||
|
}
|
||
|
}
|