Skip to content

Commit

Permalink
corrected pipeline chain calling
Browse files Browse the repository at this point in the history
  • Loading branch information
kubitre committed Sep 22, 2020
1 parent c1de97d commit 06d59f3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pipeline/environment_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (config EnvironmentConfig) GetBaseType(context *structContext) infra.GoStru
valueIndirect := reflect.Indirect(context.Value)
valueTag := context.StructField.Tag.Get(tags.TagEnvironment)

if valueTag != "" {
if !config.checkTagValue(valueTag) {
value := os.Getenv(valueTag)
if value == "" {
return infra.NewGoStructorNoValue(context.Value, errors.New("Readed value from environment was empty"))
Expand Down
16 changes: 11 additions & 5 deletions pipeline/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,14 +283,20 @@ func (pipeline *Pipeline) configuringValues(context *structContext) error {
valueIndirect := reflect.Indirect(context.Value)
switch valueIndirect.Kind() {
case reflect.Slice, reflect.Map, reflect.Array:
valueGet := pipeline.curentChain.stageFunction.GetComplexType(context)
logrus.Debug("value get from parsing slice: ", valueGet)
return pipeline.setupValue(context, &valueGet)
if pipeline.curentChain != nil {
valueGet := pipeline.curentChain.stageFunction.GetComplexType(context)
logrus.Debug("value get from parsing slice: ", valueGet)
return pipeline.setupValue(context, &valueGet)
}
return errors.New("can not be configuring complex type. Can not configured current field")
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
return errors.New("not implemented types of unsigned integer")
case reflect.String, reflect.Float32, reflect.Float64, reflect.Bool, reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
valueGet := pipeline.curentChain.stageFunction.GetBaseType(context)
return pipeline.setupValue(context, &valueGet)
if pipeline.curentChain != nil {
valueGet := pipeline.curentChain.stageFunction.GetBaseType(context)
return pipeline.setupValue(context, &valueGet)
}
return errors.New("can not be configuring base type. Can not configured current field")
default:
return errors.New("not supported type for hocon parsing")
}
Expand Down

0 comments on commit 06d59f3

Please sign in to comment.