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

File adapter + Transformer works but emits unlabeled warning #43

Closed
codepope opened this issue Jan 12, 2015 · 2 comments
Closed

File adapter + Transformer works but emits unlabeled warning #43

codepope opened this issue Jan 12, 2015 · 2 comments

Comments

@codepope
Copy link
Contributor

Run any Transformer with the File adapter and the process will work but the console will be full of

unknown type: map[string]interface {}
unknown type: map[string]interface {}
unknown type: map[string]interface {}
unknown type: map[string]interface {}
...

Reason is the File adapter emits a map. The map is detected by the Transformer's transformOne function. This then calls mejson.Marshal(msg.Data). Mejson has no code to match with a map[string]interface() so it falls through to default...

default:
        fmt.Fprintf(os.Stderr, "unknown type: %T\n", v)
        return json.Marshal(v)
    }

which emits the error but still marshals the value allowing the code to work.

Don't know whether to fix in mejson or in the transformer.

@codepope codepope changed the title File adapter + Transformer works but emits 'error' File adapter + Transformer works but emits unlabeled warning Jan 12, 2015
@nstott
Copy link
Contributor

nstott commented Jan 12, 2015

Hi,
I think this was fixed with an update to mejson, ( compose/mejson@68a977b )
Can you please try go get -u github.com/compose/mejson and rebuild your transporter?

Thanks!

@codepope
Copy link
Contributor Author

Fixed - wrong mejson was being pulled.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants