mirror of
https://github.com/containers/podman.git
synced 2025-12-01 18:49:18 +08:00
Vendor in latest c/common
Pull in updates made to the filters code for images. Filters now perform an AND operation except for th reference filter which does an OR operation for positive case but an AND operation for negative cases. Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
This commit is contained in:
13
vendor/github.com/containers/common/internal/attributedstring/slice.go
generated
vendored
13
vendor/github.com/containers/common/internal/attributedstring/slice.go
generated
vendored
@@ -42,8 +42,8 @@ func (a *Slice) Set(values []string) {
|
||||
}
|
||||
|
||||
// UnmarshalTOML is the custom unmarshal method for Slice.
|
||||
func (a *Slice) UnmarshalTOML(data interface{}) error {
|
||||
iFaceSlice, ok := data.([]interface{})
|
||||
func (a *Slice) UnmarshalTOML(data any) error {
|
||||
iFaceSlice, ok := data.([]any)
|
||||
if !ok {
|
||||
return fmt.Errorf("unable to cast to interface array: %v", data)
|
||||
}
|
||||
@@ -53,7 +53,7 @@ func (a *Slice) UnmarshalTOML(data interface{}) error {
|
||||
switch val := x.(type) {
|
||||
case string: // Strings are directly appended to the slice.
|
||||
loadedStrings = append(loadedStrings, val)
|
||||
case map[string]interface{}: // The attribute struct is represented as a map.
|
||||
case map[string]any: // The attribute struct is represented as a map.
|
||||
for k, v := range val { // Iterate over all _supported_ keys.
|
||||
switch k {
|
||||
case "append":
|
||||
@@ -81,16 +81,15 @@ func (a *Slice) UnmarshalTOML(data interface{}) error {
|
||||
|
||||
// MarshalTOML is the custom marshal method for Slice.
|
||||
func (a *Slice) MarshalTOML() ([]byte, error) {
|
||||
iFaceSlice := make([]interface{}, 0, len(a.Values))
|
||||
iFaceSlice := make([]any, 0, len(a.Values))
|
||||
|
||||
for _, x := range a.Values {
|
||||
iFaceSlice = append(iFaceSlice, x)
|
||||
}
|
||||
|
||||
if a.Attributes.Append != nil {
|
||||
Attributes := make(map[string]any)
|
||||
Attributes["append"] = *a.Attributes.Append
|
||||
iFaceSlice = append(iFaceSlice, Attributes)
|
||||
attributes := map[string]any{"append": *a.Attributes.Append}
|
||||
iFaceSlice = append(iFaceSlice, attributes)
|
||||
}
|
||||
|
||||
buf := new(bytes.Buffer)
|
||||
|
||||
Reference in New Issue
Block a user