aboutsummaryrefslogtreecommitdiff
path: root/internal/plan/placeholder.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/plan/placeholder.go')
-rw-r--r--internal/plan/placeholder.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/plan/placeholder.go b/internal/plan/placeholder.go
index 5922b07..5675e01 100644
--- a/internal/plan/placeholder.go
+++ b/internal/plan/placeholder.go
@@ -143,6 +143,9 @@ func expandOne(body string, f Facts) (string, error) {
// they point at what the config author actually wrote (B3) instead of
// hardcoding "mtime" for a {now:...} format error.
func strftime(verb, format string, t time.Time) (string, error) {
+ if format == "" {
+ return "", fmt.Errorf("{%s:} needs a format, like {%s:%%Y}", verb, verb)
+ }
var b strings.Builder
for i := 0; i < len(format); i++ {
c := format[i]