elodina / go-avro

Apache Avro for Golang
http://elodina.github.io/go-avro/
Apache License 2.0
129 stars 55 forks source link

Add enumSchema validate #81

Closed qoshi closed 8 years ago

qoshi commented 8 years ago

After looking and debug around in our project, I found you guys left TODO for EnumSchema validate function and return TRUE T_T This TRUE produces a lot of panic in our service. So I finish the validate function for our own production env. I did the follow thins:

  1. check if it is a struct
  2. check if it contains index field
  3. check if the field is in range(0<=index<len(enumSchema.Symbols))