target: ensure that each used target has NewXXXTargetResult defined

Ensure that `UnmarshalTargetResultOptions()` is called only when there
are any options to unmarshal in the JSON object.

Since results of some Targets don't have any options defined, mark
`TargetResult.Options` as optional in the JSON tag.
This commit is contained in:
Tomas Hozza 2022-06-13 16:11:46 +02:00 committed by Tom Gundersen
parent 6f13db5b92
commit 93fd5e3821
5 changed files with 135 additions and 5 deletions

View file

@ -24,3 +24,7 @@ func (AzureTargetOptions) isTargetOptions() {}
func NewAzureTarget(options *AzureTargetOptions) *Target {
return newTarget(TargetNameAzure, options)
}
func NewAzureTargetResult() *TargetResult {
return newTargetResult(TargetNameAzure, nil)
}