code: func (s *Struct) generateEnums(dir string) error {
  	for _, f := range s.Fields {
  		if f.Enum == nil {
  			continue
  		}
  		if err := f.Enum.generate(dir); err != nil {
  			return err
  		}
  	}
  	return nil
  }
docs: // generate all enums contained in this struct