From 2e286dba768de1dc043fe2ddc725f248bf21cc53 Mon Sep 17 00:00:00 2001 From: Masaaki Goshima Date: Fri, 8 Nov 2024 16:53:56 +0900 Subject: [PATCH] remove dependencies --- .github/workflows/go.yml | 2 +- .gitignore | 1 + Makefile | 30 ++++--- README.md | 9 +- cmd/ycat/go.mod | 16 ++++ cmd/ycat/go.sum | 29 +++++++ cmd/ycat/ycat.go | 6 ++ go.mod | 21 +---- go.sum | 34 -------- printer/color.go | 83 +++++++++++++++++++ printer/printer.go | 45 +++++----- testdata/go_test.mod | 19 +++++ testdata/go_test.sum | 30 +++++++ validate_test.go => testdata/validate_test.go | 0 yaml_test.go => testdata/yaml_test.go | 0 15 files changed, 234 insertions(+), 91 deletions(-) create mode 100644 cmd/ycat/go.mod create mode 100644 cmd/ycat/go.sum create mode 100644 printer/color.go create mode 100644 testdata/go_test.mod create mode 100644 testdata/go_test.sum rename validate_test.go => testdata/validate_test.go (100%) rename yaml_test.go => testdata/yaml_test.go (100%) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 27337ddb..30c30692 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -72,7 +72,7 @@ jobs: make ycat/build - name: run run: | - ./ycat .github/workflows/go.yml + ./bin/ycat .github/workflows/go.yml coverage: name: Coverage diff --git a/.gitignore b/.gitignore index e660fd93..869fe9f8 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ bin/ +cover.out diff --git a/Makefile b/Makefile index 02a38dd2..c8af8e5a 100644 --- a/Makefile +++ b/Makefile @@ -1,22 +1,35 @@ +## Location to install dependencies to +LOCALBIN ?= $(shell pwd)/bin +TESTMOD := testdata/go_test.mod + +$(LOCALBIN): + mkdir -p $(LOCALBIN) + +.PHONY: testmod + cp go.mod testdata/go_test.mod + go mod tidy -modfile=$(TESTMOD) + .PHONY: test -test: +test: testmod go test -v -race ./... + go test -v -race ./testdata -modfile=$(TESTMOD) .PHONY: simple-test -simple-test: +simple-test: testmod go test -v ./... + go test -v ./testdata -modfile=$(TESTMOD) .PHONY: cover -cover: - go test -coverprofile=cover.out ./... +cover: testmod + go test -coverpkg=.,./ast,./lexer,./parser,./printer,./scanner,./token -coverprofile=cover.out -modfile=$(TESTMOD) ./... ./testdata .PHONY: cover-html cover-html: cover go tool cover -html=cover.out .PHONY: ycat/build -ycat/build: - go build -o ycat ./cmd/ycat +ycat/build: $(LOCALBIN) + cd ./cmd/ycat && go build -o $(LOCALBIN)/ycat . .PHONY: lint lint: golangci-lint ## Run golangci-lint @@ -28,11 +41,6 @@ fmt: golangci-lint ## Ensure consistent code style @go fmt ./... @$(GOLANGCI_LINT) run --fix -## Location to install dependencies to -LOCALBIN ?= $(shell pwd)/bin -$(LOCALBIN): - mkdir -p $(LOCALBIN) - ## Tool Binaries GOLANGCI_LINT ?= $(LOCALBIN)/golangci-lint diff --git a/README.md b/README.md index 06c6ab0f..30ff96ac 100644 --- a/README.md +++ b/README.md @@ -363,9 +363,16 @@ print yaml file with color ### Installation ```sh -go install github.com/goccy/go-yaml/cmd/ycat@latest +git clone https://github.com/goccy/go-yaml.git +cd ./cmd/ycat && go insatll . ``` + +# For Developers + +> [!NOTE] +> In this project, we manage such test code under the `testdata` directory to avoid adding dependencies on libraries that are only needed for testing to the top `go.mod` file. Therefore, if you want to add test cases that use 3rd party libraries, please add the test code to the `testdata` directory. + # Looking for Sponsors I'm looking for sponsors this library. This library is being developed as a personal project in my spare time. If you want a quick response or problem resolution when using this library in your project, please register as a [sponsor](https://github.com/sponsors/goccy). I will cooperate as much as possible. Of course, this library is developed as an MIT license, so you can use it freely for free. diff --git a/cmd/ycat/go.mod b/cmd/ycat/go.mod new file mode 100644 index 00000000..a4d0ad27 --- /dev/null +++ b/cmd/ycat/go.mod @@ -0,0 +1,16 @@ +module github.com/goccy/go-yaml/cmd/ycat + +go 1.21.0 + +require ( + github.com/fatih/color v1.18.0 + github.com/goccy/go-yaml v0.0.0-00010101000000-000000000000 + github.com/mattn/go-colorable v0.1.13 +) + +require ( + github.com/mattn/go-isatty v0.0.20 // indirect + golang.org/x/sys v0.26.0 // indirect +) + +replace github.com/goccy/go-yaml => ../../ diff --git a/cmd/ycat/go.sum b/cmd/ycat/go.sum new file mode 100644 index 00000000..114171de --- /dev/null +++ b/cmd/ycat/go.sum @@ -0,0 +1,29 @@ +github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= +github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= +github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= +github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= +github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= +github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= +github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= +github.com/go-playground/validator/v10 v10.22.1 h1:40JcKH+bBNGFczGuoBYgX4I6m/i27HYW8P9FDk5PbgA= +github.com/go-playground/validator/v10 v10.22.1/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= +github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= +golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= +golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= +golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= diff --git a/cmd/ycat/ycat.go b/cmd/ycat/ycat.go index b810b6fd..7f679f1b 100644 --- a/cmd/ycat/ycat.go +++ b/cmd/ycat/ycat.go @@ -71,6 +71,12 @@ func _main(args []string) error { Suffix: format(color.Reset), } } + p.Comment = func() *printer.Property { + return &printer.Property{ + Prefix: format(color.FgHiBlack), + Suffix: format(color.Reset), + } + } writer := colorable.NewColorableStdout() _, _ = writer.Write([]byte(p.PrintTokens(tokens) + "\n")) return nil diff --git a/go.mod b/go.mod index ec1a3ebf..facf4d4a 100644 --- a/go.mod +++ b/go.mod @@ -1,22 +1,3 @@ module github.com/goccy/go-yaml -go 1.19 - -require ( - github.com/fatih/color v1.18.0 - github.com/go-playground/validator/v10 v10.22.1 - github.com/google/go-cmp v0.6.0 - github.com/mattn/go-colorable v0.1.13 -) - -require ( - github.com/gabriel-vasile/mimetype v1.4.3 // indirect - github.com/go-playground/locales v0.14.1 // indirect - github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/leodido/go-urn v1.4.0 // indirect - github.com/mattn/go-isatty v0.0.20 // indirect - golang.org/x/crypto v0.28.0 // indirect - golang.org/x/net v0.30.0 // indirect - golang.org/x/sys v0.26.0 // indirect - golang.org/x/text v0.19.0 // indirect -) +go 1.21.0 diff --git a/go.sum b/go.sum index d71ac9ab..e69de29b 100644 --- a/go.sum +++ b/go.sum @@ -1,34 +0,0 @@ -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= -github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= -github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= -github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= -github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= -github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= -github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= -github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= -github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.22.1 h1:40JcKH+bBNGFczGuoBYgX4I6m/i27HYW8P9FDk5PbgA= -github.com/go-playground/validator/v10 v10.22.1/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= -github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= -github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= -github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= -github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= -github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= -golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= -golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= -golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= -golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= -golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/printer/color.go b/printer/color.go new file mode 100644 index 00000000..79d7d7c6 --- /dev/null +++ b/printer/color.go @@ -0,0 +1,83 @@ +// This source inspired by https://github.com/fatih/color. +package printer + +import ( + "fmt" + "strings" +) + +type ColorAttribute int + +const ( + ColorReset ColorAttribute = iota + ColorBold + ColorFaint + ColorItalic + ColorUnderline + ColorBlinkSlow + ColorBlinkRapid + ColorReverseVideo + ColorConcealed + ColorCrossedOut +) + +const ( + ColorFgHiBlack ColorAttribute = iota + 90 + ColorFgHiRed + ColorFgHiGreen + ColorFgHiYellow + ColorFgHiBlue + ColorFgHiMagenta + ColorFgHiCyan + ColorFgHiWhite +) + +const ( + ColorResetBold ColorAttribute = iota + 22 + ColorResetItalic + ColorResetUnderline + ColorResetBlinking + + ColorResetReversed + ColorResetConcealed + ColorResetCrossedOut +) + +const escape = "\x1b" + +var colorResetMap = map[ColorAttribute]ColorAttribute{ + ColorBold: ColorResetBold, + ColorFaint: ColorResetBold, + ColorItalic: ColorResetItalic, + ColorUnderline: ColorResetUnderline, + ColorBlinkSlow: ColorResetBlinking, + ColorBlinkRapid: ColorResetBlinking, + ColorReverseVideo: ColorResetReversed, + ColorConcealed: ColorResetConcealed, + ColorCrossedOut: ColorResetCrossedOut, +} + +func format(attrs ...ColorAttribute) string { + format := make([]string, 0, len(attrs)) + for _, attr := range attrs { + format = append(format, fmt.Sprint(attr)) + } + return fmt.Sprintf("%s[%sm", escape, strings.Join(format, ";")) +} + +func unformat(attrs ...ColorAttribute) string { + format := make([]string, len(attrs)) + for _, attr := range attrs { + v := fmt.Sprint(ColorReset) + reset, exists := colorResetMap[attr] + if exists { + v = fmt.Sprint(reset) + } + format = append(format, v) + } + return fmt.Sprintf("%s[%sm", escape, strings.Join(format, ";")) +} + +func colorize(msg string, attrs ...ColorAttribute) string { + return format(attrs...) + msg + unformat(attrs...) +} diff --git a/printer/printer.go b/printer/printer.go index c7148129..e2a7c3c3 100644 --- a/printer/printer.go +++ b/printer/printer.go @@ -5,8 +5,6 @@ import ( "math" "strings" - "github.com/fatih/color" - "github.com/goccy/go-yaml/ast" "github.com/goccy/go-yaml/token" ) @@ -151,47 +149,47 @@ func (p *Printer) PrintNode(node ast.Node) []byte { return []byte(fmt.Sprintf("%+v\n", node)) } -const escape = "\x1b" - -func format(attr color.Attribute) string { - return fmt.Sprintf("%s[%dm", escape, attr) -} - func (p *Printer) setDefaultColorSet() { p.Bool = func() *Property { return &Property{ - Prefix: format(color.FgHiMagenta), - Suffix: format(color.Reset), + Prefix: format(ColorFgHiMagenta), + Suffix: format(ColorReset), } } p.Number = func() *Property { return &Property{ - Prefix: format(color.FgHiMagenta), - Suffix: format(color.Reset), + Prefix: format(ColorFgHiMagenta), + Suffix: format(ColorReset), } } p.MapKey = func() *Property { return &Property{ - Prefix: format(color.FgHiCyan), - Suffix: format(color.Reset), + Prefix: format(ColorFgHiCyan), + Suffix: format(ColorReset), } } p.Anchor = func() *Property { return &Property{ - Prefix: format(color.FgHiYellow), - Suffix: format(color.Reset), + Prefix: format(ColorFgHiYellow), + Suffix: format(ColorReset), } } p.Alias = func() *Property { return &Property{ - Prefix: format(color.FgHiYellow), - Suffix: format(color.Reset), + Prefix: format(ColorFgHiYellow), + Suffix: format(ColorReset), } } p.String = func() *Property { return &Property{ - Prefix: format(color.FgHiGreen), - Suffix: format(color.Reset), + Prefix: format(ColorFgHiGreen), + Suffix: format(ColorReset), + } + } + p.Comment = func() *Property { + return &Property{ + Prefix: format(ColorFgHiBlack), + Suffix: format(ColorReset), } } } @@ -199,9 +197,9 @@ func (p *Printer) setDefaultColorSet() { func (p *Printer) PrintErrorMessage(msg string, isColored bool) string { if isColored { return fmt.Sprintf("%s%s%s", - format(color.FgHiRed), + format(ColorFgHiRed), msg, - format(color.Reset), + format(ColorReset), ) } return msg @@ -324,8 +322,7 @@ func (p *Printer) setupErrorTokenFormat(annotateLine int, isColored bool) { p.LineNumber = true p.LineNumberFormat = func(num int) string { if isColored { - fn := color.New(color.Bold, color.FgHiWhite).SprintFunc() - return fn(prefix(annotateLine, num)) + return colorize(prefix(annotateLine, num), ColorBold, ColorFgHiWhite) } return prefix(annotateLine, num) } diff --git a/testdata/go_test.mod b/testdata/go_test.mod new file mode 100644 index 00000000..a19e3cdb --- /dev/null +++ b/testdata/go_test.mod @@ -0,0 +1,19 @@ +module github.com/goccy/go-yaml + +go 1.21.0 + +require ( + github.com/go-playground/validator/v10 v10.22.1 + github.com/google/go-cmp v0.6.0 +) + +require ( + github.com/gabriel-vasile/mimetype v1.4.3 // indirect + github.com/go-playground/locales v0.14.1 // indirect + github.com/go-playground/universal-translator v0.18.1 // indirect + github.com/leodido/go-urn v1.4.0 // indirect + golang.org/x/crypto v0.28.0 // indirect + golang.org/x/net v0.30.0 // indirect + golang.org/x/sys v0.26.0 // indirect + golang.org/x/text v0.19.0 // indirect +) diff --git a/testdata/go_test.sum b/testdata/go_test.sum new file mode 100644 index 00000000..f5b1fa3c --- /dev/null +++ b/testdata/go_test.sum @@ -0,0 +1,30 @@ +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= +github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= +github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= +github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= +github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= +github.com/go-playground/validator/v10 v10.22.1 h1:40JcKH+bBNGFczGuoBYgX4I6m/i27HYW8P9FDk5PbgA= +github.com/go-playground/validator/v10 v10.22.1/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= +github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= +golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= +golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= +golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/validate_test.go b/testdata/validate_test.go similarity index 100% rename from validate_test.go rename to testdata/validate_test.go diff --git a/yaml_test.go b/testdata/yaml_test.go similarity index 100% rename from yaml_test.go rename to testdata/yaml_test.go