Upgrade go-yaml to v4.0.0
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"go.yaml.in/yaml/v4"
|
||||
"go.yaml.in/yaml/v4/plugin/limit"
|
||||
"go.yaml.in/yaml/v4/plugin/loaderlimits"
|
||||
|
||||
"go.maximumdirect.net/configkit/internal/document"
|
||||
)
|
||||
@@ -60,7 +60,7 @@ func Parse(input io.Reader, sourceID string, limits Limits) (*document.Node, []I
|
||||
parserDepth = limits.Depth + 2
|
||||
}
|
||||
depthExceeded := false
|
||||
plugin := limit.New(limit.DepthFunc(func(depth int, _ *limit.DepthContext) error {
|
||||
plugin := loaderlimits.New(loaderlimits.DepthFunc(func(depth int, _ *loaderlimits.DepthContext) error {
|
||||
if depth > parserDepth {
|
||||
depthExceeded = true
|
||||
return errParserDepth
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"go.yaml.in/yaml/v4"
|
||||
"go.yaml.in/yaml/v4/plugin/limit"
|
||||
"go.yaml.in/yaml/v4/plugin/loaderlimits"
|
||||
|
||||
"go.maximumdirect.net/configkit/internal/document"
|
||||
)
|
||||
@@ -167,7 +167,7 @@ func TestParserDepthCalibrationForBlockAndFlow(t *testing.T) {
|
||||
func observedParserDepth(t *testing.T, input string) int {
|
||||
t.Helper()
|
||||
maximum := 0
|
||||
depthPlugin := limit.New(limit.DepthFunc(func(depth int, _ *limit.DepthContext) error {
|
||||
depthPlugin := loaderlimits.New(loaderlimits.DepthFunc(func(depth int, _ *loaderlimits.DepthContext) error {
|
||||
maximum = max(maximum, depth)
|
||||
return nil
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user