private void preAddField(Structure structure) throws IOException {
		if (fieldOffset >= 0) {
			int currentOffset = getStructLength(structure);
			if (currentOffset > fieldOffset) {
				throw new IOException("Invalid field offset %d, structure is already %d"
						.formatted(fieldOffset, currentOffset));
			}
			if (currentOffset < fieldOffset) {
				structure.add(Undefined.getUndefinedDataType(fieldOffset - currentOffset), -1);
			}
		}
	}
Returns the value of this java field.

@param <R> type of the result value
@param structInstance object containing the field
@param expectedType expected class of the value 
@return value of the field, or null if the field's value is not of expected type
@throws IOException if error accessing java field
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/golang/structmapping/FieldOutputInfo.java