public DataType getElementDataType() {
		DataType dt = context != null ? context.getContainingFieldDataType() : null;
		if (dt != null && dt instanceof Structure struct && struct.getNumDefinedComponents() > 0) {
			int elementPtrFieldOrdinal = 0;	// hacky hard coded knowledge that the pointer to the data is the first element of the slice struct
			DataTypeComponent elementPtrDTC = struct.getComponent(elementPtrFieldOrdinal);
			DataType elementPtrDT = elementPtrDTC.getDataType();
			return elementPtrDT instanceof Pointer ptrDT ? ptrDT.getDataType() : null;
		}
		return null;
	}
Returns the {@link DataType} of elements of this slice, as detected by the type information
contained in the struct field that contains this slice.
<p>
Returns null if this slice instance was not nested (contained) in a structure.  If the
slice data type wasn't a specialized slice data type (it was "runtime.slice" instead of
"[]element"), void data type will be returned.

@return data type of the elements of this slice, if possible, or null
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/golang/rtti/GoSlice.java