Update pkg/configbuilder/buildconfigfile.go

Co-Authored-By: John Gardiner Myers <jgmyers@proofpoint.com>
This commit is contained in:
Roberto Rodriguez Alcala 2020-01-25 10:07:21 -08:00 committed by GitHub
parent 99c57b6d87
commit f5c8e46ae2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -113,7 +113,7 @@ func BuildConfigYaml(options interface{}) ([]byte, error) {
func getValueFromStruct(keyWithDots string, object *SchedulerConfig) (*reflect.Value, error) {
keySlice := strings.Split(keyWithDots, ".")
v := reflect.ValueOf(object)
// iterate through field names ,ignore the first name as it might be the current instance name
// iterate through field names, ignoring the first name as it might be the current instance name
// you can make it recursive also if want to support types like slice,map etc along with struct
for _, key := range keySlice {
for v.Kind() == reflect.Ptr {