fix and simplify resource_put & resource_put_test
@@ -12,11 +12,11 @@ func (resource *resource) Put(
spec runtime.ProcessSpec,
runnable runtime.Runner,
) (runtime.VersionResult, error) {
- vr := &runtime.VersionResult{}
+ vr := runtime.VersionResult{}
inputArgs, err := resource.Signature()
if err != nil {
- return *vr, err
+ return vr, err
}
err = runnable.RunScript(
@@ -24,16 +24,16 @@ func (resource *resource) Put(
spec.Path,
[]string{spec.Dir},
inputArgs,
- vr,
+ &vr,
spec.StderrWriter,
true,
)
if err != nil {
return runtime.VersionResult{}, err
}
- if vr == nil {
+ if vr.Version == nil {
return runtime.VersionResult{}, fmt.Errorf("resource script (%s %s) output a null version", spec.Path, spec.Dir)
}
- return *vr, nil
+ return vr, nil
}
