Unify the omitempty configuration of YAML annotation

This commit is contained in:
Xinzhao Xu
2022-02-21 16:25:55 +08:00
parent f50de9af65
commit c53001c5dc
20 changed files with 68 additions and 70 deletions

View File

@@ -3,13 +3,13 @@ package gpu
import "github.com/spf13/pflag"
type GPUKind struct {
ResourceName string `json:"resourceName,omitempty" yaml:"resourceName"`
ResourceType string `json:"resourceType,omitempty" yaml:"resourceType"`
Default bool `json:"default,omitempty" yaml:"default"`
ResourceName string `json:"resourceName,omitempty" yaml:"resourceName,omitempty"`
ResourceType string `json:"resourceType,omitempty" yaml:"resourceType,omitempty"`
Default bool `json:"default,omitempty" yaml:"default,omitempty"`
}
type Options struct {
Kinds []GPUKind `json:"kinds,omitempty" yaml:"kinds"`
Kinds []GPUKind `json:"kinds,omitempty" yaml:"kinds,omitempty"`
}
func NewGPUOptions() *Options {