Skip to content

Commit

Permalink
feat: validate input is enum value
Browse files Browse the repository at this point in the history
Tinyblargon committed Jul 14, 2023
1 parent ca58b91 commit daeb78f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion proxmox/config_guest.go
Original file line number Diff line number Diff line change
@@ -146,7 +146,11 @@ const (

// check if the guest has the specified feature.
func GuestHasFeature(vmr *VmRef, client *Client, feature GuestFeature) (bool, error) {
err := client.CheckVmRef(vmr)
err := feature.Validate()
if err != nil {
return false, err
}
err = client.CheckVmRef(vmr)
if err != nil {
return false, err
}

0 comments on commit daeb78f

Please sign in to comment.