Source:
<code>private static void checkPrint( @NotNull ProblemsHolder holder, @NotNull GoCallExpr callExpr, @NotNull GoFunctionOrMethodDeclaration declaration) { List<GoExpression> arguments = callExpr.getArgumentList().getExpressionList(); if (arguments.isEmpty()) return; GoExpression firstArg = arguments.get(0); if (GoTypeUtil.isString(firstArg.getGoType(null))) { String firstArgText = GoPlaceholderChecker.resolve(firstArg); if (firstArgText != null) { <START> if (GoPlaceholderChecker.hasPlaceholder(firstArgText)) { <END> String message = "Possible formatting directive in <code>#ref</code>"; holder.registerProblem(firstArg, message, ProblemHighlightType.GENERIC_ERROR_OR_WARNING); return; } } } String declarationName = declaration.getName(); boolean isLn = declarationName != null && declarationName.endsWith("ln"); for (GoExpression argument : arguments) { GoType goType = argument.getGoType(null); if (isLn && GoTypeUtil.isString(goType)) { String argText = GoPlaceholderChecker.resolve(argument); if (argText != null && argText.endsWith("\\n")) { String message = "Function already ends with new line"; holder.registerProblem(argument, message, ProblemHighlightType.GENERIC_ERROR_OR_WARNING); } } else if (GoTypeUtil.isFunction(goType)) { String message = "Argument <code>#ref</code> is not a function call"; if (argument instanceof GoCallExpr) { message = "Final return type of <code>#ref</code> is a function not a function call"; } holder.registerProblem(argument, message, ProblemHighlightType.GENERIC_ERROR_OR_WARNING); } } }</code><technical_language>string % highlighted? fmt.Println("10%")</technical_language>

Target:
private static void checkPrint(@NotNull ProblemsHolder holder, @NotNull GoCallExpr callExpr, @NotNull GoFunctionOrMethodDeclaration declaration) { List<GoExpression> arguments = callExpr.getArgumentList().getExpressionList(); if (arguments.isEmpty()) return; GoExpression firstArg = arguments.get(0); if (GoTypeUtil.isString(firstArg.getGoType(null))) { String firstArgText = resolve(firstArg); if (firstArgText != null) { if (GoPlaceholderChecker.hasPlaceholder(firstArgText)) { String message = "Possible formatting directive in <code>#ref</code> #loc"; holder.registerProblem(firstArg, message, ProblemHighlightType.GENERIC_ERROR_OR_WARNING); return; } } } String declarationName = declaration.getName(); boolean isLn = declarationName != null && declarationName.endsWith("ln"); for (GoExpression argument : arguments) { GoType goType = argument.getGoType(null); if (isLn && GoTypeUtil.isString(goType)) { String argText = resolve(argument); if (argText != null && argText.endsWith("\\n")) { String message = "Function already ends with new line #loc"; TextRange range = TextRange.create(argText.length() - 1, argText.length() + 1); holder.registerProblem(argument, message, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, range); } } else if (GoTypeUtil.isFunction(goType)) { String message = "Argument <code>#ref</code> is not a function call #loc"; if (argument instanceof GoCallExpr) { message = "Final return type of <code>#ref</code> is a function not a function call #loc"; } holder.registerProblem(argument, message, ProblemHighlightType.GENERIC_ERROR_OR_WARNING); } } }