Skip to content
This repository has been archived by the owner on Oct 17, 2018. It is now read-only.

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
Chao Wang committed Oct 17, 2017
1 parent 76d9239 commit bee3b56
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions policy/aggregation_type_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,35 +158,8 @@ var (
noopTransformType,
suffixTransformType,
}
validTypeStringTransformFnTypes = []string{
string(noopTransformType),
string(suffixTransformType),
}
)

func (t *transformType) UnmarshalYAML(unmarshal func(interface{}) error) error {
fmt.Println("called")
var str string
if err := unmarshal(&str); err != nil {
return err
}
if str == "" {
*t = noopTransformType
return nil
}
var validStrings []string
for _, validType := range validTypes {
validString := string(validType)
if validString == str {
*t = validType
return nil
}
validStrings = append(validStrings, validString)
}

return fmt.Errorf("invalid transform type %s, valid types are: %v", str, validStrings)
}

func (t transformType) TransformFn() (TypeStringTransformFn, error) {
switch t {
case noopTransformType:
Expand Down

0 comments on commit bee3b56

Please sign in to comment.