@@ -14,12 +14,13 @@ import (
1414func HandleOutputsReferences (smgr statemanager.Manager , options configmanager.RawOptions ) []error {
1515 errorsList := make ([]error , 0 )
1616
17- for optionKey , optionValue := range options {
17+ for optionKey , optionInterface := range options {
18+ switch optionValue := optionInterface .(type ) {
1819 // only process string values in the options
1920 // since all outputs references are strings, not ints, not booleans, not maps
20- if optionValueStr , ok := optionValue .( string ); ok {
21- log .Debugf ("Before: %s: %s" , optionKey , optionValueStr )
22- match , toolName , instanceID , outputReferenceKey := getToolNamePluginOutputKey (optionValueStr )
21+ case string :
22+ log .Debugf ("Before: %s: %s" , optionKey , optionValue )
23+ match , toolName , instanceID , outputReferenceKey := getToolNamePluginOutputKey (optionValue )
2324 // do nothing, if the value string isn't in the format of a valid output reference
2425 if ! match {
2526 continue
@@ -30,18 +31,17 @@ func HandleOutputsReferences(smgr statemanager.Manager, options configmanager.Ra
3031 continue
3132 }
3233 if val , ok := outputs [outputReferenceKey ]; ok {
33- options [optionKey ] = replaceOutputKeyWithValue (optionValueStr , val .(string ))
34+ options [optionKey ] = replaceOutputKeyWithValue (optionValue , val .(string ))
3435 log .Debugf ("After: %s: %s" , optionKey , options [optionKey ])
3536 } else {
3637 errorsList = append (errorsList , fmt .Errorf ("can't find Output reference key %s" , outputReferenceKey ))
3738 }
38- }
39-
40- // recursive if the value is a map (which means Tool.Option is a nested map)
41- optionValueMap , ok := optionValue .(map [string ]interface {})
42- log .Debugf ("Got nested map: %v" , optionValueMap )
43- if ok {
44- errorsList = append (errorsList , HandleOutputsReferences (smgr , optionValueMap )... )
39+ case configmanager.RawOptions :
40+ // recursive if the value is a map (which means Tool.Option is a nested map)
41+ log .Debugf ("Got nested map: %v" , optionValue )
42+ errorsList = append (errorsList , HandleOutputsReferences (smgr , optionValue )... )
43+ default :
44+ log .Warnf ("option %+v process output can't get valid type" , optionInterface )
4545 }
4646 }
4747
0 commit comments