Skip to content
This repository has been archived by the owner on Apr 27, 2022. It is now read-only.

parser panic on wrong type conversion #17

Open
cocap10 opened this issue May 18, 2016 · 1 comment
Open

parser panic on wrong type conversion #17

cocap10 opened this issue May 18, 2016 · 1 comment
Labels

Comments

@cocap10
Copy link
Contributor

cocap10 commented May 18, 2016

Flaeg panics if types in custom parsers don't match each other
In func (s *SliceStrings) SetValue(val interface{})

panic: interface conversion: interface is Namespaces, not []string

Example :

// Namespaces holds kubernetes namespaces
type Namespaces []string
//...
f.AddParser(reflect.TypeOf(Namespaces{}), &flaeg.SliceStrings{})
@cocap10
Copy link
Contributor Author

cocap10 commented May 18, 2016

Try to fix it :
AddParser func(typ reflect.Type, parser Parser) error
could return an error if typ and parser don't match each other
see https://github.com/containous/flaeg/tree/fix-parser-type-conversion

@ldez ldez added the bug label Apr 29, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants