public static GoBuildInfo read(BinaryReader reader, Program program) throws IOException {
		byte[] magicBytes = reader.readNextByteArray(GO_BUILDINF_MAGIC.length /* 14 */);
		if (!Arrays.equals(magicBytes, GO_BUILDINF_MAGIC)) {
			throw new IOException("Missing GoBuildInfo magic");
		}
		int pointerSize = reader.readNextUnsignedByte();
		int flags = reader.readNextUnsignedByte();
		Endian endian = (flags & FLAG_ENDIAN) == 0 ? Endian.LITTLE : Endian.BIG;
		boolean inlineStr = (flags & FLAG_INLINE_STRING) != 0;

		if (reader.isBigEndian() && endian != Endian.BIG) {
			throw new IOException("Mixed endian-ness");
		}

		DataTypeManager dtm = program.getDataTypeManager();
		StructureDataType struct =
			new StructureDataType(GoConstants.GOLANG_CATEGORYPATH, "GoBuildInfo", 0, dtm);
		struct.add(new ArrayDataType(ASCII, 14, -1, dtm), "magic", "\\xff Go buildinf:");
		struct.add(BYTE, "ptrSize", null);
		struct.add(BYTE, "flags", null);

		return readStringInfo(reader, inlineStr, program, pointerSize, struct);
	}
Reads a GoBuildInfo ".go.buildinfo" section from the specified stream.

@param reader BinaryReader that contains the ".go.buildinfo" section
@param program Program that contains the ".go.buildinfo" section
@return new {@link GoBuildInfo} instance, never null
@throws IOException if error reading or bad data
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/golang/GoBuildInfo.java