func (s *SegmentUnmarshalerGenerator) Generate() (io.Reader, error) {
	fieldExtractor := &fieldExtractor{
		segment: s.segment,
		file:    s.file,
		fileSet: s.fileSet,
	}
	sortedFields, err := fieldExtractor.extractFields()
	if err != nil {
		return nil, err
	}

	r, _ := utf8.DecodeRuneInString(s.segment.Name)
	nameVar := string(unicode.ToLower(r))
	templObj := &segmentTemplateObject{
		Package:       s.packageName,
		Name:          s.segment.Name,
		NameVar:       nameVar,
		InterfaceName: s.segment.InterfaceName,
		Fields:        sortedFields,
	}
	executor := &segmentTemplateExecutor{templObj}
	return executor.execute()
}
// Generate generates an unmarhsaler for the segment definition and provides it
// as an io.Reader
Generate generates an unmarhsaler for the segment definition and provides it
as an io.Reader
// Generate generates an unmarhsaler for the segment definition and provides it // as an io . Reader
func (s *SegmentUnmarshalerGenerator) Generate() (io.Reader, error) {
	fieldExtractor := &fieldExtractor{
		segment: s.segment,
		file:    s.file,
		fileSet: s.fileSet,
	}
	sortedFields, err := fieldExtractor.extractFields()
	if err != nil {
		return nil, err
	}
	r, _ := utf8.DecodeRuneInString(s.segment.Name)
	nameVar := string(unicode.ToLower(r))
	templObj := &segmentTemplateObject{
		Package:       s.packageName,
		Name:          s.segment.Name,
		NameVar:       nameVar,
		InterfaceName: s.segment.InterfaceName,
		Fields:        sortedFields,
	}
	executor := &segmentTemplateExecutor{templObj}
	return executor.execute()
}
func ( s * SegmentUnmarshalerGenerator ) Generate ( ) ( io . Reader , error ) { fieldExtractor := & fieldExtractor { segment : s . segment , file : s . file , fileSet : s . fileSet , } sortedFields , err := fieldExtractor . extractFields ( ) if err != nil { return nil , err } r , _ := utf8 . DecodeRuneInString ( s . segment . Name ) nameVar := string ( unicode . ToLower ( r ) ) templObj := & segmentTemplateObject { Package : s . packageName , Name : s . segment . Name , NameVar : nameVar , InterfaceName : s . segment . InterfaceName , Fields : sortedFields , } executor := & segmentTemplateExecutor { templObj } return executor . execute ( ) }
Generate generates an unmarhsaler for the segment definition and provides it
as an io.Reader
Generate generates an unmarhsaler for the segment definition and provides it as an io . Reader