summaryrefslogtreecommitdiffstats
path: root/tpl/resources/resources.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-11-17 17:17:36 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-11-17 18:09:54 +0100
commita99fed4852b65f94f4936fbc6c308068c05f2a2d (patch)
tree1ba8bb0b28aa523179f51ab2cc7f78982fd21b56 /tpl/resources/resources.go
parentdb945a6ed2ab12de04502957151d55779cbdd39d (diff)
resources/tpl: Add a test for resources.Get
Updates #10101
Diffstat (limited to 'tpl/resources/resources.go')
-rw-r--r--tpl/resources/resources.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/tpl/resources/resources.go b/tpl/resources/resources.go
index d8f06761d..fe6fd0434 100644
--- a/tpl/resources/resources.go
+++ b/tpl/resources/resources.go
@@ -125,13 +125,14 @@ func (ns *Namespace) Copy(s any, r resource.Resource) (resource.Resource, error)
func (ns *Namespace) Get(filename any) resource.Resource {
filenamestr, err := cast.ToStringE(filename)
+ if err != nil {
+ panic(err)
+ }
if filenamestr == "" {
return nil
}
- if err != nil {
- panic(err)
- }
+
r, err := ns.createClient.Get(filenamestr)
if err != nil {
panic(err)