ugorji / go

idiomatic codec and rpc lib for msgpack, cbor, json, etc. msgpack.org[Go]
MIT License
1.86k stars 295 forks source link

#W-2862586 replace '-' to '_' in package alias #127

Closed agupt closed 8 years ago

agupt commented 8 years ago

Issue #126

ugorji commented 8 years ago

Thanks much for the PR.

This is not a complete solution. The full solution would involve ensuring that packageName is a true golang identifier (i.e. starting with a unicodeletter or , followed by a sequence or unicode_letters, unicodedigits or ). This means that the tpkg[idx+1:] should be replaced with a string that converts any unicode character which is not a unicode_letter, unicodedigit or into an _.

I suggest adding a function to do this: func toGoIdentifierPfx(s string) string, and using that in place of strings.Replace(...).

ugorji commented 8 years ago

I'm working on codec now, so I will make the full fix on my end and submit. Let me know if you want to handle this soon.