fix(deps): update module github.com/onsi/gomega to v1.38.0

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This commit is contained in:
renovate[bot]
2025-07-23 00:15:40 +00:00
committed by GitHub
parent 62dd921ad9
commit ca5deaace1
7 changed files with 50 additions and 7 deletions

2
go.mod
View File

@@ -51,7 +51,7 @@ require (
github.com/moby/term v0.5.2
github.com/nxadm/tail v1.4.11
github.com/onsi/ginkgo/v2 v2.23.4
github.com/onsi/gomega v1.37.0
github.com/onsi/gomega v1.38.0
github.com/opencontainers/cgroups v0.0.4
github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec v1.1.1

4
go.sum
View File

@@ -321,8 +321,8 @@ github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY=
github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc=
github.com/onsi/ginkgo/v2 v2.23.4 h1:ktYTpKJAVZnDT4VjxSbiBenUjmlL/5QkBEocaWXiQus=
github.com/onsi/ginkgo/v2 v2.23.4/go.mod h1:Bt66ApGPBFzHyR+JO10Zbt0Gsp4uWxu5mIOTusL46e8=
github.com/onsi/gomega v1.37.0 h1:CdEG8g0S133B4OswTDC/5XPSzE1OeP29QOioj2PID2Y=
github.com/onsi/gomega v1.37.0/go.mod h1:8D9+Txp43QWKhM24yyOBEdpkzN8FvJyAwecBgsU4KU0=
github.com/onsi/gomega v1.38.0 h1:c/WX+w8SLAinvuKKQFh77WEucCnPk4j2OTUr7lt7BeY=
github.com/onsi/gomega v1.38.0/go.mod h1:OcXcwId0b9QsE7Y49u+BTrL4IdKOBOKnD6VQNTJEB6o=
github.com/opencontainers/cgroups v0.0.4 h1:XVj8P/IHVms/j+7eh8ggdkTLAxjz84ZzuFyGoE28DR4=
github.com/opencontainers/cgroups v0.0.4/go.mod h1:s8lktyhlGUqM7OSRL5P7eAW6Wb+kWPNvt4qvVfzA5vs=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=

View File

@@ -1,3 +1,22 @@
## 1.38.0
### Features
- gstruct handles extra unexported fields [4ee7ed0]
### Fixes
- support [] in IgnoringTopFunction function signatures (#851) [36bbf72]
### Maintenance
- Bump golang.org/x/net from 0.40.0 to 0.41.0 (#846) [529d408]
- Fix typo [acd1f55]
- Bump google.golang.org/protobuf from 1.36.5 to 1.36.6 (#835) [bae65a0]
- Bump nokogiri from 1.18.4 to 1.18.8 in /docs (#842) [8dda91f]
- Bump golang.org/x/net from 0.39.0 to 0.40.0 (#843) [212d812]
- Bump github.com/onsi/ginkgo/v2 from 2.23.3 to 2.23.4 (#839) [59bd7f9]
- Bump nokogiri from 1.18.1 to 1.18.4 in /docs (#834) [328c729]
- Bump uri from 1.0.2 to 1.0.3 in /docs (#826) [9a798a1]
- Bump golang.org/x/net from 0.37.0 to 0.39.0 (#841) [04a72c6]
## 1.37.0
### Features

View File

@@ -22,7 +22,7 @@ import (
"github.com/onsi/gomega/types"
)
const GOMEGA_VERSION = "1.37.0"
const GOMEGA_VERSION = "1.38.0"
const nilGomegaPanic = `You are trying to make an assertion, but haven't registered Gomega's fail handler.
If you're using Ginkgo then you probably forgot to put your assertion in an It().
@@ -178,7 +178,7 @@ func ensureDefaultGomegaIsConfigured() {
// All subsequent arguments will be required to be nil/zero.
//
// This is convenient if you want to make an assertion on a method/function that returns
// a value and an error - a common patter in Go.
// a value and an error - a common pattern in Go.
//
// For example, given a function with signature:
//

View File

@@ -8,6 +8,7 @@ import (
"reflect"
"runtime/debug"
"strings"
"unicode"
"github.com/onsi/gomega/format"
errorsutil "github.com/onsi/gomega/gstruct/errors"
@@ -65,6 +66,7 @@ func MatchFields(options Options, fields Fields) types.GomegaMatcher {
return &FieldsMatcher{
Fields: fields,
IgnoreExtras: options&IgnoreExtras != 0,
IgnoreUnexportedExtras: options&IgnoreUnexportedExtras != 0,
IgnoreMissing: options&IgnoreMissing != 0,
}
}
@@ -75,6 +77,8 @@ type FieldsMatcher struct {
// Whether to ignore extra elements or consider it an error.
IgnoreExtras bool
// Whether to ignore unexported extra elements or consider it an error.
IgnoreUnexportedExtras bool
// Whether to ignore missing elements or consider it an error.
IgnoreMissing bool
@@ -97,6 +101,14 @@ func (m *FieldsMatcher) Match(actual any) (success bool, err error) {
return true, nil
}
func isExported(fieldName string) bool {
if fieldName == "" {
return false
}
r := []rune(fieldName)[0]
return unicode.IsUpper(r)
}
func (m *FieldsMatcher) matchFields(actual any) (errs []error) {
val := reflect.ValueOf(actual)
typ := val.Type()
@@ -116,13 +128,21 @@ func (m *FieldsMatcher) matchFields(actual any) (errs []error) {
matcher, expected := m.Fields[fieldName]
if !expected {
if m.IgnoreUnexportedExtras && !isExported(fieldName) {
return nil
}
if !m.IgnoreExtras {
return fmt.Errorf("unexpected field %s: %+v", fieldName, actual)
}
return nil
}
field := val.Field(i).Interface()
var field any
if _, isIgnoreMatcher := matcher.(*IgnoreMatcher) ; isIgnoreMatcher {
field = struct {}{} // the matcher does not care about the actual value
} else {
field = val.Field(i).Interface()
}
match, err := matcher.Match(field)
if err != nil {

View File

@@ -12,4 +12,8 @@ const (
//considered by the identifier function. All members that map to a given key must still match successfully
//with the matcher that is provided for that key.
AllowDuplicates
//IgnoreUnexportedExtras tells the matcher to ignore extra unexported fields, rather than triggering a failure.
//it is not possible to check the value of unexported fields, so this option is only useful when you want to
//check every exported fields, but you don't care about extra unexported fields.
IgnoreUnexportedExtras
)

2
vendor/modules.txt vendored
View File

@@ -725,7 +725,7 @@ github.com/onsi/ginkgo/v2/internal/parallel_support
github.com/onsi/ginkgo/v2/internal/testingtproxy
github.com/onsi/ginkgo/v2/reporters
github.com/onsi/ginkgo/v2/types
# github.com/onsi/gomega v1.37.0
# github.com/onsi/gomega v1.38.0
## explicit; go 1.23.0
github.com/onsi/gomega
github.com/onsi/gomega/format