private int markupStaticStructRefsInFunction(Function function, TaskMonitor monitor)
			throws IOException, CancelledException {

		ReferenceManager refManager = goBinary.getProgram().getReferenceManager();
		Listing listing = goBinary.getProgram().getListing();

		int stringCount = 0;

		AddressSet stringDataRange = new AddressSet(goBinary.getStringDataRange());
		AddressSetView validStructRange = goBinary.getStringStructRange();
		AddressSetView funcBody = function.getBody();
		for (Reference ref : refManager.getReferenceIterator(function.getEntryPoint())) {
			monitor.increment();
			if (!funcBody.contains(ref.getFromAddress())) {
				// limit the reference iterator to the function body
				break;
			}
			Address addr = ref.getToAddress();

			if (ref.getReferenceType() != RefType.DATA) {
				continue;
			}
			if (validStructRange.contains(addr) && canCreateStructAt(addr)) {
				if (tryCreateStruct(stringDataRange, addr) != null) {
					stringCount++;
					continue;
				}

				if (!stringDataRange.contains(addr)) {
					continue;
				}

				Instruction instr = listing.getInstructionContaining(ref.getFromAddress());
				GoString inlineStr = tryCreateInlineString(funcBody, stringDataRange, addr, instr,
					this::isValidStringData);
				if (inlineStr != null) {
					// just markup the char data, there is no struct body
					inlineStr.additionalMarkup(markupSession);
					stringCount++;
				}
			}
		}

		return stringCount;
	}
Analyzer that finds Golang strings (and optionally slices) and marks up the found instances.
<p>
The char[] data for Golang strings does not contain null terminators, so the normal logic already
built into Ghidra to find terminated strings doesn't work.
<p>
This implementation looks for data that matches what a Golang string 
struct { char* data, long len } would look like, and follows the pointer to the char[] data 
and creates a fixed-length string at that location using the length info from the struct.
<p>
The string struct is found in a couple of different ways:
<ul>
	<li>References from an instruction (see markupStaticStructRefsInFunction)</li>
 <li>Iterating through data segments and making educated guesses (see markupDataSegmentStructs)</li>
</ul>
Some char[] data is only referenced from Golang string structs that exist temporarily
in registers after being set by an instruction that statically references the char[] data,
and an instruction that statically contains the length. (see tryCreateInlineString) 
<p>
Because slice structures can look like string structs, possible string struct locations are also
examined for slice-ness.  When marking a struct as a slice instead of as a string, the data
pointed to by the slice is not marked up because there is no information about the size of the
elements that the slice points to.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/GolangStringAnalyzer.java