Remove redundant variable declarations
This commit is contained in:
@@ -28,19 +28,15 @@ func validateSaveSettingsBundle(req *proto.SaveSettingsBundleRequest) error {
|
|||||||
if err := validateBundleIdentifier(req.SettingsBundle.Identifier); err != nil {
|
if err := validateBundleIdentifier(req.SettingsBundle.Identifier); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
bundleErrors := validation.ValidateStruct(
|
return validation.ValidateStruct(
|
||||||
req.SettingsBundle,
|
req.SettingsBundle,
|
||||||
validation.Field(&req.SettingsBundle.DisplayName, validation.Required),
|
validation.Field(&req.SettingsBundle.DisplayName, validation.Required),
|
||||||
validation.Field(&req.SettingsBundle.Settings, validation.Required),
|
validation.Field(&req.SettingsBundle.Settings, validation.Required),
|
||||||
)
|
)
|
||||||
return bundleErrors
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func validateGetSettingsBundle(req *proto.GetSettingsBundleRequest) error {
|
func validateGetSettingsBundle(req *proto.GetSettingsBundleRequest) error {
|
||||||
if err := validateBundleIdentifier(req.Identifier); err != nil {
|
return validateBundleIdentifier(req.Identifier)
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func validateListSettingsBundles(req *proto.ListSettingsBundlesRequest) error {
|
func validateListSettingsBundles(req *proto.ListSettingsBundlesRequest) error {
|
||||||
@@ -51,17 +47,11 @@ func validateListSettingsBundles(req *proto.ListSettingsBundlesRequest) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func validateSaveSettingsValue(req *proto.SaveSettingsValueRequest) error {
|
func validateSaveSettingsValue(req *proto.SaveSettingsValueRequest) error {
|
||||||
if err := validateValueIdentifier(req.SettingsValue.Identifier); err != nil {
|
return validateValueIdentifier(req.SettingsValue.Identifier)
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func validateGetSettingsValue(req *proto.GetSettingsValueRequest) error {
|
func validateGetSettingsValue(req *proto.GetSettingsValueRequest) error {
|
||||||
if err := validateValueIdentifier(req.Identifier); err != nil {
|
return validateValueIdentifier(req.Identifier)
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func validateListSettingsValues(req *proto.ListSettingsValuesRequest) error {
|
func validateListSettingsValues(req *proto.ListSettingsValuesRequest) error {
|
||||||
|
|||||||
Reference in New Issue
Block a user