From f2408c88a60d5296089ab306c258e725fd512b96 Mon Sep 17 00:00:00 2001 From: Blake Rouse Date: Fri, 7 Feb 2020 12:55:32 -0500 Subject: [PATCH 1/5] Upgrade go-ucfg to master, for testing before 0.8.2 release. --- .../github.com/elastic/go-ucfg/CHANGELOG.md | 3 + vendor/github.com/elastic/go-ucfg/error.go | 8 +++ vendor/github.com/elastic/go-ucfg/reify.go | 13 ++-- .../github.com/elastic/go-ucfg/validator.go | 34 +++++++-- vendor/vendor.json | 70 +++++++++---------- 5 files changed, 82 insertions(+), 46 deletions(-) diff --git a/vendor/github.com/elastic/go-ucfg/CHANGELOG.md b/vendor/github.com/elastic/go-ucfg/CHANGELOG.md index 4349863cb7b7..f031736e16a6 100644 --- a/vendor/github.com/elastic/go-ucfg/CHANGELOG.md +++ b/vendor/github.com/elastic/go-ucfg/CHANGELOG.md @@ -13,6 +13,9 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Removed ### Fixed +- Fixed nonzero validator to not fail on nil array or slice. #147 +- Fixed nonzero validator to validate maps. +- Fixed required validator to validate maps. ## [0.8.1] diff --git a/vendor/github.com/elastic/go-ucfg/error.go b/vendor/github.com/elastic/go-ucfg/error.go index a48690e30a82..d944bac66d92 100644 --- a/vendor/github.com/elastic/go-ucfg/error.go +++ b/vendor/github.com/elastic/go-ucfg/error.go @@ -98,6 +98,14 @@ var ( ErrRequired = errors.New("missing required field") ErrEmpty = errors.New("empty field") + + ErrArrayEmpty = errors.New("empty array") + + ErrMapEmpty = errors.New("empty map") + + ErrRegexEmpty = errors.New("regex value is not set") + + ErrStringEmpty = errors.New("string value is not set") ) // Error Classes diff --git a/vendor/github.com/elastic/go-ucfg/reify.go b/vendor/github.com/elastic/go-ucfg/reify.go index ad14f95baf75..11dea0a53ad8 100644 --- a/vendor/github.com/elastic/go-ucfg/reify.go +++ b/vendor/github.com/elastic/go-ucfg/reify.go @@ -167,7 +167,7 @@ func reifyInto(opts *options, to reflect.Value, from *Config) Error { switch k { case reflect.Map: - return reifyMap(opts, to, from) + return reifyMap(opts, to, from, nil) case reflect.Struct: return reifyStruct(opts, to, from) case reflect.Slice, reflect.Array: @@ -183,7 +183,7 @@ func reifyInto(opts *options, to reflect.Value, from *Config) Error { return raiseInvalidTopLevelType(to.Interface(), opts.meta) } -func reifyMap(opts *options, to reflect.Value, from *Config) Error { +func reifyMap(opts *options, to reflect.Value, from *Config, validators []validatorTag) Error { parentFields := opts.activeFields defer func() { opts.activeFields = parentFields }() @@ -198,7 +198,7 @@ func reifyMap(opts *options, to reflect.Value, from *Config) Error { fields := from.fields.dict() if len(fields) == 0 { - if err := tryRecursiveValidate(to, opts, nil); err != nil { + if err := tryRecursiveValidate(to, opts, validators); err != nil { return raiseValidation(from.ctx, from.metadata, "", err) } return nil @@ -224,6 +224,9 @@ func reifyMap(opts *options, to reflect.Value, from *Config) Error { to.SetMapIndex(key, v) } + if err := runValidators(to.Interface(), validators); err != nil { + return raiseValidation(from.ctx, from.metadata, "", err) + } if err := tryValidate(to); err != nil { return raiseValidation(from.ctx, from.metadata, "", err) } @@ -321,7 +324,7 @@ func reifyGetField( } // Primitive types return early when it doesn't implement the Initializer interface. - if fieldType.Kind() != reflect.Map && fieldType.Kind() != reflect.Struct && !hasInitDefaults(fieldType) { + if fieldType.Kind() != reflect.Struct && !hasInitDefaults(fieldType) { if err := tryRecursiveValidate(to, opts.opts, opts.validators); err != nil { return raiseValidation(cfg.ctx, cfg.metadata, name, err) } @@ -479,7 +482,7 @@ func reifyMergeValue( if err != nil { return reflect.Value{}, raiseExpectedObject(opts.opts, val) } - return old, reifyMap(opts.opts, old, sub) + return old, reifyMap(opts.opts, old, sub, opts.validators) case reflect.Struct: sub, err := val.toConfig(opts.opts) diff --git a/vendor/github.com/elastic/go-ucfg/validator.go b/vendor/github.com/elastic/go-ucfg/validator.go index b56e8835dfd7..8a72abf3b335 100644 --- a/vendor/github.com/elastic/go-ucfg/validator.go +++ b/vendor/github.com/elastic/go-ucfg/validator.go @@ -392,31 +392,53 @@ func validateRequired(v interface{}, name string) error { } return nil } - if err := validateNonEmpty(v, name); err != nil { - return ErrRequired + if err := validateNonEmptyWithAllowNil(v, name, false); err != nil { + return err } return nil } -func validateNonEmpty(v interface{}, _ string) error { +func validateNonEmpty(v interface{}, name string) error { + return validateNonEmptyWithAllowNil(v, name, true) +} + +func validateNonEmptyWithAllowNil(v interface{}, _ string, allowNil bool) error { if s, ok := v.(string); ok { if s == "" { - return ErrEmpty + return ErrStringEmpty } return nil } if r, ok := v.(regexp.Regexp); ok { if r.String() == "" { - return ErrEmpty + return ErrRegexEmpty } return nil } val := reflect.ValueOf(v) if val.Kind() == reflect.Array || val.Kind() == reflect.Slice { + if val.IsNil() { + if allowNil { + return nil + } + return ErrRequired + } + if val.Len() == 0 { + return ErrArrayEmpty + } + return nil + } + if val.Kind() == reflect.Map { + if val.IsNil() { + if allowNil { + return nil + } + return ErrRequired + } if val.Len() == 0 { - return ErrEmpty + return ErrMapEmpty } return nil } diff --git a/vendor/vendor.json b/vendor/vendor.json index 4b29c2259ebd..71edd25dc921 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -3268,76 +3268,76 @@ "versionExact": "v0.0.7" }, { - "checksumSHA1": "a1x0prr3ix+QFOdJpNfM3Q4G6Es=", + "checksumSHA1": "nCTxgxkHy4AaSLBBNeW58SHtzvw=", "path": "github.com/elastic/go-ucfg", - "revision": "093a6898c440d2e5e93abf09850068c60428b2cd", - "revisionTime": "2020-01-31T13:55:22Z", - "version": "v0.8.1", - "versionExact": "v0.8.1" + "revision": "1afd60fccd49ad59108117cb0998273b98bc702f", + "revisionTime": "2020-02-05T21:23:20Z", + "version": "master", + "versionExact": "master" }, { "checksumSHA1": "X+R/CD8SokJrmlxFTx2nSevRDhQ=", "path": "github.com/elastic/go-ucfg/cfgutil", - "revision": "093a6898c440d2e5e93abf09850068c60428b2cd", - "revisionTime": "2020-01-31T13:55:22Z", - "version": "v0.8.1", - "versionExact": "v0.8.1" + "revision": "1afd60fccd49ad59108117cb0998273b98bc702f", + "revisionTime": "2020-02-05T21:23:20Z", + "version": "master", + "versionExact": "master" }, { "checksumSHA1": "B58nBBiUIstpkXfr9yaYN9GzdLE=", "path": "github.com/elastic/go-ucfg/diff", - "revision": "093a6898c440d2e5e93abf09850068c60428b2cd", - "revisionTime": "2020-01-31T13:55:22Z", - "version": "v0.8.1", - "versionExact": "v0.8.1" + "revision": "1afd60fccd49ad59108117cb0998273b98bc702f", + "revisionTime": "2020-02-05T21:23:20Z", + "version": "master", + "versionExact": "master" }, { "checksumSHA1": "E6k6DWkpI+LOKDIFRqRmNH9GORc=", "path": "github.com/elastic/go-ucfg/flag", - "revision": "093a6898c440d2e5e93abf09850068c60428b2cd", - "revisionTime": "2020-01-31T13:55:22Z", - "version": "v0.8.1", - "versionExact": "v0.8.1" + "revision": "1afd60fccd49ad59108117cb0998273b98bc702f", + "revisionTime": "2020-02-05T21:23:20Z", + "version": "master", + "versionExact": "master" }, { "checksumSHA1": "NhiQQjYMs/ViCbmEq9tll2uCaYo=", "path": "github.com/elastic/go-ucfg/hjson", - "revision": "093a6898c440d2e5e93abf09850068c60428b2cd", - "revisionTime": "2020-01-31T13:55:22Z", - "version": "v0.8.1", - "versionExact": "v0.8.1" + "revision": "1afd60fccd49ad59108117cb0998273b98bc702f", + "revisionTime": "2020-02-05T21:23:20Z", + "version": "master", + "versionExact": "master" }, { "checksumSHA1": "esXpiQlEvTOUwsE0nNesso8albo=", "path": "github.com/elastic/go-ucfg/internal/parse", "revision": "0539807037ce820e147797f051ff32b05f4f9288", "revisionTime": "2019-01-28T11:18:48Z", - "version": "v0.8.1", - "versionExact": "v0.8.1" + "version": "master", + "versionExact": "master" }, { "checksumSHA1": "cfMNsyQm0gZOV0hRJrBSdKDQSBo=", "path": "github.com/elastic/go-ucfg/json", - "revision": "093a6898c440d2e5e93abf09850068c60428b2cd", - "revisionTime": "2020-01-31T13:55:22Z", - "version": "v0.8.1", - "versionExact": "v0.8.1" + "revision": "1afd60fccd49ad59108117cb0998273b98bc702f", + "revisionTime": "2020-02-05T21:23:20Z", + "version": "master", + "versionExact": "master" }, { "checksumSHA1": "ZISq+zzSb0OLzvwLlf1ObdgnFmM=", "path": "github.com/elastic/go-ucfg/parse", - "revision": "093a6898c440d2e5e93abf09850068c60428b2cd", - "revisionTime": "2020-01-31T13:55:22Z", - "version": "v0.8.1", - "versionExact": "v0.8.1" + "revision": "1afd60fccd49ad59108117cb0998273b98bc702f", + "revisionTime": "2020-02-05T21:23:20Z", + "version": "master", + "versionExact": "master" }, { "checksumSHA1": "cnJVnptTvXNLzxVhd266k19/pQg=", "path": "github.com/elastic/go-ucfg/yaml", - "revision": "093a6898c440d2e5e93abf09850068c60428b2cd", - "revisionTime": "2020-01-31T13:55:22Z", - "version": "v0.8.1", - "versionExact": "v0.8.1" + "revision": "1afd60fccd49ad59108117cb0998273b98bc702f", + "revisionTime": "2020-02-05T21:23:20Z", + "version": "master", + "versionExact": "master" }, { "checksumSHA1": "iI1JCWsrAPpoKcEo/i6G3lRLIVs=", From 05fe93a857998b5469a62ba874199057e12d28fd Mon Sep 17 00:00:00 2001 From: Blake Rouse Date: Fri, 7 Feb 2020 13:13:55 -0500 Subject: [PATCH 2/5] Update notice. --- NOTICE.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NOTICE.txt b/NOTICE.txt index 1bee6d854de6..b4b94bf7f3de 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -1391,8 +1391,8 @@ Apache License 2.0 -------------------------------------------------------------------- Dependency: github.com/elastic/go-ucfg -Version: v0.8.1 -Revision: 093a6898c440d2e5e93abf09850068c60428b2cd +Version: master +Revision: 1afd60fccd49ad59108117cb0998273b98bc702f License type (autodetected): Apache-2.0 ./vendor/github.com/elastic/go-ucfg/LICENSE: -------------------------------------------------------------------- From 6223cbeface02fe612ad8ce392b98498c321bfa9 Mon Sep 17 00:00:00 2001 From: Blake Rouse Date: Fri, 7 Feb 2020 14:03:31 -0500 Subject: [PATCH 3/5] Fix tests. --- filebeat/fileset/modules_test.go | 6 +++--- metricbeat/mb/lightmodules_test.go | 12 ++++++------ metricbeat/mb/mb_test.go | 4 ++-- .../module/prometheus/collector/_meta/data.json | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/filebeat/fileset/modules_test.go b/filebeat/fileset/modules_test.go index d82f33618655..c9a346b2fb1f 100644 --- a/filebeat/fileset/modules_test.go +++ b/filebeat/fileset/modules_test.go @@ -347,8 +347,8 @@ func TestMcfgFromConfig(t *testing.T) { Filesets: map[string]*FilesetConfig{ "error": { Enabled: &falseVar, - Var: map[string]interface{}{}, - Input: map[string]interface{}{}, + Var: nil, + Input: nil, }, }, }, @@ -366,7 +366,7 @@ func TestMcfgFromConfig(t *testing.T) { Var: map[string]interface{}{ "test": false, }, - Input: map[string]interface{}{}, + Input: nil, }, }, }, diff --git a/metricbeat/mb/lightmodules_test.go b/metricbeat/mb/lightmodules_test.go index e7a933cc47aa..fdc550333557 100644 --- a/metricbeat/mb/lightmodules_test.go +++ b/metricbeat/mb/lightmodules_test.go @@ -194,22 +194,22 @@ func TestNewModuleFromConfig(t *testing.T) { "normal module": { config: common.MapStr{"module": "foo", "metricsets": []string{"bar"}}, expectedOption: "default", - expectedQuery: QueryParams{}, + expectedQuery: nil, }, "light module": { config: common.MapStr{"module": "service", "metricsets": []string{"metricset"}}, expectedOption: "test", - expectedQuery: QueryParams{}, + expectedQuery: nil, }, "light module default metricset": { config: common.MapStr{"module": "service"}, expectedOption: "test", - expectedQuery: QueryParams{}, + expectedQuery: nil, }, "light module override option": { config: common.MapStr{"module": "service", "option": "overriden"}, expectedOption: "overriden", - expectedQuery: QueryParams{}, + expectedQuery: nil, }, "light module with query": { config: common.MapStr{"module": "service", "query": common.MapStr{"param": "foo"}}, @@ -220,7 +220,7 @@ func TestNewModuleFromConfig(t *testing.T) { config: common.MapStr{"module": "service", "period": "42s"}, expectedOption: "test", expectedPeriod: 42 * time.Second, - expectedQuery: QueryParams{}, + expectedQuery: nil, }, "light module is broken": { config: common.MapStr{"module": "broken"}, @@ -237,7 +237,7 @@ func TestNewModuleFromConfig(t *testing.T) { "mixed module with standard and light metricsets": { config: common.MapStr{"module": "mixed", "metricsets": []string{"standard", "light"}}, expectedOption: "default", - expectedQuery: QueryParams{}, + expectedQuery: nil, }, "mixed module with unregistered and light metricsets": { config: common.MapStr{"module": "mixedbroken", "metricsets": []string{"unregistered", "light"}}, diff --git a/metricbeat/mb/mb_test.go b/metricbeat/mb/mb_test.go index 3094e1588d63..4da0e4c85acf 100644 --- a/metricbeat/mb/mb_test.go +++ b/metricbeat/mb/mb_test.go @@ -83,7 +83,7 @@ func TestModuleConfig(t *testing.T) { { name: "missing required field", in: map[string]interface{}{}, - err: "missing required field accessing 'module'", + err: "string value is not set accessing 'module'", }, { name: "valid config", @@ -97,7 +97,7 @@ func TestModuleConfig(t *testing.T) { Enabled: true, Period: time.Second * 10, Timeout: 0, - Query: QueryParams{}, + Query: nil, }, }, { diff --git a/metricbeat/module/prometheus/collector/_meta/data.json b/metricbeat/module/prometheus/collector/_meta/data.json index da3bc9439604..dba9f7771c45 100644 --- a/metricbeat/module/prometheus/collector/_meta/data.json +++ b/metricbeat/module/prometheus/collector/_meta/data.json @@ -23,4 +23,4 @@ "address": "127.0.0.1:55555", "type": "prometheus" } -} +} \ No newline at end of file From c967caa1a0e6fd77814820e75a8151542d029291 Mon Sep 17 00:00:00 2001 From: Blake Rouse Date: Mon, 10 Feb 2020 09:59:04 -0500 Subject: [PATCH 4/5] Update to the v0.8.2 release tag and remake NOTICE.txt. --- NOTICE.txt | 4 +- .../github.com/elastic/go-ucfg/CHANGELOG.md | 7 +- vendor/vendor.json | 70 +++++++++---------- 3 files changed, 43 insertions(+), 38 deletions(-) diff --git a/NOTICE.txt b/NOTICE.txt index b4b94bf7f3de..09658f3904ea 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -1391,8 +1391,8 @@ Apache License 2.0 -------------------------------------------------------------------- Dependency: github.com/elastic/go-ucfg -Version: master -Revision: 1afd60fccd49ad59108117cb0998273b98bc702f +Version: v0.8.2 +Revision: ab69586e10820006b250d04c98cc3b848e227808 License type (autodetected): Apache-2.0 ./vendor/github.com/elastic/go-ucfg/LICENSE: -------------------------------------------------------------------- diff --git a/vendor/github.com/elastic/go-ucfg/CHANGELOG.md b/vendor/github.com/elastic/go-ucfg/CHANGELOG.md index f031736e16a6..01a9ea1d2950 100644 --- a/vendor/github.com/elastic/go-ucfg/CHANGELOG.md +++ b/vendor/github.com/elastic/go-ucfg/CHANGELOG.md @@ -12,6 +12,10 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Removed +### Fixed + +## [0.8.2] + ### Fixed - Fixed nonzero validator to not fail on nil array or slice. #147 - Fixed nonzero validator to validate maps. @@ -259,7 +263,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Introduced CHANGELOG.md for documenting changes to ucfg. -[Unreleased]: https://github.com/elastic/go-ucfg/compare/v0.8.1...HEAD +[Unreleased]: https://github.com/elastic/go-ucfg/compare/v0.8.2...HEAD +[0.8.2]: https://github.com/elastic/go-ucfg/compare/v0.8.1...v0.8.2 [0.8.1]: https://github.com/elastic/go-ucfg/compare/v0.8.0...v0.8.1 [0.8.0]: https://github.com/elastic/go-ucfg/compare/v0.7.0...v0.8.0 [0.7.0]: https://github.com/elastic/go-ucfg/compare/v0.6.5...v0.7.0 diff --git a/vendor/vendor.json b/vendor/vendor.json index 71edd25dc921..35cce37fe271 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -3268,76 +3268,76 @@ "versionExact": "v0.0.7" }, { - "checksumSHA1": "nCTxgxkHy4AaSLBBNeW58SHtzvw=", + "checksumSHA1": "VPcK6uPDligSrbdi1yVeGivPvno=", "path": "github.com/elastic/go-ucfg", - "revision": "1afd60fccd49ad59108117cb0998273b98bc702f", - "revisionTime": "2020-02-05T21:23:20Z", - "version": "master", - "versionExact": "master" + "revision": "ab69586e10820006b250d04c98cc3b848e227808", + "revisionTime": "2020-02-07T21:56:35Z", + "version": "v0.8.2", + "versionExact": "v0.8.2" }, { "checksumSHA1": "X+R/CD8SokJrmlxFTx2nSevRDhQ=", "path": "github.com/elastic/go-ucfg/cfgutil", - "revision": "1afd60fccd49ad59108117cb0998273b98bc702f", - "revisionTime": "2020-02-05T21:23:20Z", - "version": "master", - "versionExact": "master" + "revision": "ab69586e10820006b250d04c98cc3b848e227808", + "revisionTime": "2020-02-07T21:56:35Z", + "version": "v0.8.2", + "versionExact": "v0.8.2" }, { "checksumSHA1": "B58nBBiUIstpkXfr9yaYN9GzdLE=", "path": "github.com/elastic/go-ucfg/diff", - "revision": "1afd60fccd49ad59108117cb0998273b98bc702f", - "revisionTime": "2020-02-05T21:23:20Z", - "version": "master", - "versionExact": "master" + "revision": "ab69586e10820006b250d04c98cc3b848e227808", + "revisionTime": "2020-02-07T21:56:35Z", + "version": "v0.8.2", + "versionExact": "v0.8.2" }, { "checksumSHA1": "E6k6DWkpI+LOKDIFRqRmNH9GORc=", "path": "github.com/elastic/go-ucfg/flag", - "revision": "1afd60fccd49ad59108117cb0998273b98bc702f", - "revisionTime": "2020-02-05T21:23:20Z", - "version": "master", - "versionExact": "master" + "revision": "ab69586e10820006b250d04c98cc3b848e227808", + "revisionTime": "2020-02-07T21:56:35Z", + "version": "v0.8.2", + "versionExact": "v0.8.2" }, { "checksumSHA1": "NhiQQjYMs/ViCbmEq9tll2uCaYo=", "path": "github.com/elastic/go-ucfg/hjson", - "revision": "1afd60fccd49ad59108117cb0998273b98bc702f", - "revisionTime": "2020-02-05T21:23:20Z", - "version": "master", - "versionExact": "master" + "revision": "ab69586e10820006b250d04c98cc3b848e227808", + "revisionTime": "2020-02-07T21:56:35Z", + "version": "v0.8.2", + "versionExact": "v0.8.2" }, { "checksumSHA1": "esXpiQlEvTOUwsE0nNesso8albo=", "path": "github.com/elastic/go-ucfg/internal/parse", "revision": "0539807037ce820e147797f051ff32b05f4f9288", "revisionTime": "2019-01-28T11:18:48Z", - "version": "master", - "versionExact": "master" + "version": "v0.8.2", + "versionExact": "v0.8.2" }, { "checksumSHA1": "cfMNsyQm0gZOV0hRJrBSdKDQSBo=", "path": "github.com/elastic/go-ucfg/json", - "revision": "1afd60fccd49ad59108117cb0998273b98bc702f", - "revisionTime": "2020-02-05T21:23:20Z", - "version": "master", - "versionExact": "master" + "revision": "ab69586e10820006b250d04c98cc3b848e227808", + "revisionTime": "2020-02-07T21:56:35Z", + "version": "v0.8.2", + "versionExact": "v0.8.2" }, { "checksumSHA1": "ZISq+zzSb0OLzvwLlf1ObdgnFmM=", "path": "github.com/elastic/go-ucfg/parse", - "revision": "1afd60fccd49ad59108117cb0998273b98bc702f", - "revisionTime": "2020-02-05T21:23:20Z", - "version": "master", - "versionExact": "master" + "revision": "ab69586e10820006b250d04c98cc3b848e227808", + "revisionTime": "2020-02-07T21:56:35Z", + "version": "v0.8.2", + "versionExact": "v0.8.2" }, { "checksumSHA1": "cnJVnptTvXNLzxVhd266k19/pQg=", "path": "github.com/elastic/go-ucfg/yaml", - "revision": "1afd60fccd49ad59108117cb0998273b98bc702f", - "revisionTime": "2020-02-05T21:23:20Z", - "version": "master", - "versionExact": "master" + "revision": "ab69586e10820006b250d04c98cc3b848e227808", + "revisionTime": "2020-02-07T21:56:35Z", + "version": "v0.8.2", + "versionExact": "v0.8.2" }, { "checksumSHA1": "iI1JCWsrAPpoKcEo/i6G3lRLIVs=", From 7f67e7ef7a0f75b8cd88610ffda30f4b4d89e203 Mon Sep 17 00:00:00 2001 From: Blake Rouse Date: Tue, 11 Feb 2020 16:12:02 -0500 Subject: [PATCH 5/5] Improve test name. --- metricbeat/mb/mb_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metricbeat/mb/mb_test.go b/metricbeat/mb/mb_test.go index 4da0e4c85acf..f93721d8a81e 100644 --- a/metricbeat/mb/mb_test.go +++ b/metricbeat/mb/mb_test.go @@ -81,7 +81,7 @@ func TestModuleConfig(t *testing.T) { err string }{ { - name: "missing required field", + name: "string value is not set on required field", in: map[string]interface{}{}, err: "string value is not set accessing 'module'", },