func readFirstHeader(r ReadSeekCloser) error {
	var hdr1 ShapeFileHeader1
	hdr1.Unused[1] = math.MaxInt32 // to detect possible corruption
	err := binary.Read(r, binary.BigEndian, &hdr1)
	if err != nil {
		return err
	}

	err = hdr1.Validate()
	if err != nil {
		return err
	}

	return nil
}
// Read primary header (notice endianness!)
Read primary header (notice endianness!)
// Read primary header ( notice endianness! )
func readFirstHeader(r ReadSeekCloser) error {
	var hdr1 ShapeFileHeader1
	hdr1.Unused[1] = math.MaxInt32 
	err := binary.Read(r, binary.BigEndian, &hdr1)
	if err != nil {
		return err
	}
	err = hdr1.Validate()
	if err != nil {
		return err
	}
	return nil
}
func readFirstHeader ( r ReadSeekCloser ) error { var hdr1 ShapeFileHeader1 hdr1 . Unused [ 1 ] = math . MaxInt32 err := binary . Read ( r , binary . BigEndian , & hdr1 ) if err != nil { return err } err = hdr1 . Validate ( ) if err != nil { return err } return nil }
Read primary header (notice endianness!)
Read primary header ( notice endianness! )
// to detect possible corruption