Merge pull request #13672 from containerd/dependabot/go_modules/github.com/pelletier/go-toml/v2-2.4.2

build(deps): bump github.com/pelletier/go-toml/v2 from 2.4.1 to 2.4.2
This commit is contained in:
Fu Wei
2026-07-04 20:44:29 +00:00
committed by GitHub
4 changed files with 16 additions and 11 deletions

2
go.mod
View File

@@ -57,7 +57,7 @@ require (
github.com/opencontainers/runtime-spec v1.3.0
github.com/opencontainers/runtime-tools v0.9.1-0.20251114084447-edf4cb3d2116
github.com/opencontainers/selinux v1.13.1
github.com/pelletier/go-toml/v2 v2.4.1
github.com/pelletier/go-toml/v2 v2.4.2
github.com/prometheus/client_golang v1.23.2
github.com/prometheus/client_model v0.6.2
github.com/sirupsen/logrus v1.9.4

4
go.sum
View File

@@ -271,8 +271,8 @@ github.com/opencontainers/runtime-tools v0.9.1-0.20251114084447-edf4cb3d2116 h1:
github.com/opencontainers/runtime-tools v0.9.1-0.20251114084447-edf4cb3d2116/go.mod h1:DKDEfzxvRkoQ6n9TGhxQgg2IM1lY4aM0eaQP4e3oElw=
github.com/opencontainers/selinux v1.13.1 h1:A8nNeceYngH9Ow++M+VVEwJVpdFmrlxsN22F+ISDCJE=
github.com/opencontainers/selinux v1.13.1/go.mod h1:S10WXZ/osk2kWOYKy1x2f/eXF5ZHJoUs8UU/2caNRbg=
github.com/pelletier/go-toml/v2 v2.4.1 h1:j5OMOImsH+j2k7GJ5YO+RxfWwohNiH6t5zB/+h3bagc=
github.com/pelletier/go-toml/v2 v2.4.1/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=
github.com/pelletier/go-toml/v2 v2.4.2 h1:M2fKKbmyvI+hGId/D0W64qDBMVhJnNR10O5gIbMc//Q=
github.com/pelletier/go-toml/v2 v2.4.2/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=
github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 h1:Dx7Ovyv/SFnMFw3fD4oEoeorXc6saIiQ23LrGLth0Gw=
github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=

View File

@@ -2238,14 +2238,16 @@ func addFields(plan *structPlan, t reflect.Type, prefix []int) {
f := t.Field(i)
tag, tagged := f.Tag.Lookup("toml")
name := f.Name
explicitName := ""
if tagged {
// A tag of exactly "-" drops the field. "-," names it "-".
if tag == "-" {
continue
}
parts := strings.SplitN(tag, ",", 2)
if parts[0] != "" {
name = parts[0]
explicitName = parts[0]
if explicitName != "" {
name = explicitName
}
}
if f.Anonymous {
@@ -2257,14 +2259,17 @@ func addFields(plan *structPlan, t reflect.Type, prefix []int) {
// Embedded non-struct fields are not decoded into.
continue
}
if !tagged {
// Untagged embedded structs are flattened, even when their
// type is unexported: only their own exported fields are
// reachable.
if explicitName == "" {
// Embedded structs without an explicit tag name are flattened,
// even when their type is unexported: only their own exported
// fields are reachable. A tag that only sets options (e.g.
// `,inline`) still flattens, matching encoding/json and the
// encoder's behavior.
embedded = append(embedded, f)
continue
}
// A tagged embedded struct acts as a regular named field.
// An embedded struct given an explicit tag name acts as a regular
// named field.
} else if f.PkgPath != "" {
// unexported
continue

2
vendor/modules.txt vendored
View File

@@ -465,7 +465,7 @@ github.com/opencontainers/runtime-tools/validate/capabilities
github.com/opencontainers/selinux/go-selinux
github.com/opencontainers/selinux/go-selinux/label
github.com/opencontainers/selinux/pkg/pwalkdir
# github.com/pelletier/go-toml/v2 v2.4.1
# github.com/pelletier/go-toml/v2 v2.4.2
## explicit; go 1.21.0
github.com/pelletier/go-toml/v2
github.com/pelletier/go-toml/v2/internal/parserbridge