Repository: gohugoio/hugo (language: go)

Issue:
Improve error message in resources.Concat
```
 <resources.Concat>: error calling Concat: slice []interface {} not supported in concat
```

The above is probably a slice of `nil`-- which means that the resources in the previous step wasn't found -- which would be a better error message.


Discussion / hints:

Fix patch:
diff --git a/tpl/resources/resources.go b/tpl/resources/resources.go
index 78340b1ff2b..5c2068b68f5 100644
--- a/tpl/resources/resources.go
+++ b/tpl/resources/resources.go
@@ -224,7 +224,7 @@ func (ns *Namespace) Concat(targetPathIn any, r any) (resource.Resource, error)
 	case resource.ResourcesConverter:
 		rr = v.ToResources()
 	default:
-		return nil, fmt.Errorf("slice %T not supported in concat", r)
+		return nil, fmt.Errorf("expected slice of Resource objects, received %T instead", r)
 	}
 
 	if len(rr) == 0 {


Test patch: