fix(deps): update github.com/containers/common digest to 3e93a76

Signed-off-by: Renovate Bot <bot@renovateapp.com>
This commit is contained in:
renovate[bot]
2023-05-06 11:14:08 +00:00
committed by GitHub
parent ace3cba5c1
commit 11d92ea376
228 changed files with 24071 additions and 1551 deletions

View File

@ -16,6 +16,7 @@ package spec
import (
"encoding/json"
"strconv"
"strings"
"github.com/go-openapi/jsonpointer"
@ -40,6 +41,24 @@ func (e Extensions) GetString(key string) (string, bool) {
return "", false
}
// GetInt gets a int value from the extensions
func (e Extensions) GetInt(key string) (int, bool) {
realKey := strings.ToLower(key)
if v, ok := e.GetString(realKey); ok {
if r, err := strconv.Atoi(v); err == nil {
return r, true
}
}
if v, ok := e[realKey]; ok {
if r, rOk := v.(float64); rOk {
return int(r), true
}
}
return -1, false
}
// GetBool gets a string value from the extensions
func (e Extensions) GetBool(key string) (bool, bool) {
if v, ok := e[strings.ToLower(key)]; ok {