From d8c3385814b6f32ec132b3a6e2d7c705e519565c Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Tue, 7 Jan 2020 12:45:42 +0100 Subject: [PATCH] hcl2template/mock.go: add fields with named types --- hcl2template/mock.go | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/hcl2template/mock.go b/hcl2template/mock.go index 8576a0439..1386eb8b7 100644 --- a/hcl2template/mock.go +++ b/hcl2template/mock.go @@ -12,14 +12,16 @@ import ( ) type NestedMockConfig struct { - String string `mapstructure:"string"` - Int int `mapstructure:"int"` - Int64 int64 `mapstructure:"int64"` - Bool bool `mapstructure:"bool"` - Trilean config.Trilean `mapstructure:"trilean"` - Duration time.Duration `mapstructure:"duration"` - MapStringString map[string]string `mapstructure:"map_string_string"` - SliceString []string `mapstructure:"slice_string"` + String string `mapstructure:"string"` + Int int `mapstructure:"int"` + Int64 int64 `mapstructure:"int64"` + Bool bool `mapstructure:"bool"` + Trilean config.Trilean `mapstructure:"trilean"` + Duration time.Duration `mapstructure:"duration"` + MapStringString map[string]string `mapstructure:"map_string_string"` + SliceString []string `mapstructure:"slice_string"` + NamedMapStringString NamedMapStringString `mapstructure:"named_map_string_string"` + NamedString NamedString `mapstructure:"named_string"` } type MockConfig struct { @@ -118,3 +120,10 @@ func (b *MockCommunicator) Configure(raws ...interface{}) ([]string, error) { Interpolate: true, }, raws...) } + +////// +// Utils +////// + +type NamedMapStringString map[string]string +type NamedString string