func NewFlashRegionSection(data []byte) (*FlashRegionSection, error) {
	if len(data) < FlashRegionSectionSize {
		return nil, fmt.Errorf("flash Region Section size too small: expected %v bytes, got %v",
			FlashRegionSectionSize,
			len(data),
		)
	}
	var region FlashRegionSection
	reader := bytes.NewReader(data)
	if err := binary.Read(reader, binary.LittleEndian, &region); err != nil {
		return nil, err
	}
	return &region, nil
}
NewFlashRegionSection initializes a FlashRegionSection from a slice of bytes
package uefi
import (
	"bytes"
	"encoding/binary"
	"fmt"
	"strings"
)
const FlashRegionSectionSize = 64
type FlashRegionSection struct {
	_                   uint16
	FlashBlockEraseSize uint16
	FlashRegions [15]FlashRegion
}
func (f *FlashRegionSection) ValidRegions() []string {
	var regions []string
	for i, r := range f.FlashRegions {
		if r.Valid() {
			regions = append(regions, flashRegionTypeNames[FlashRegionType(i)])
		}
	}
	return regions
}
func (f *FlashRegionSection) String() string {
	return fmt.Sprintf("FlashRegionSection{Regions=%v}",
		strings.Join(f.ValidRegions(), ","),
	)
}