go: Add ability to run testable examples (#39390)

See related discussion #39381.

<img width="724" height="488"
src="https://github.com/user-attachments/assets/4a69e13e-783f-45d7-99f4-e23c0415a781"
/>

Release Notes:

- Added ability to run Go Testable Examples
This commit is contained in:
Lev Zakharov
2025-10-08 22:55:26 +02:00
committed by GitHub
parent ca89a40df2
commit 81b98cdd4d
2 changed files with 62 additions and 0 deletions
+9
View File
@@ -71,6 +71,15 @@
(#set! tag go-subtest)
)
; Functions names start with `Example`
(
(
(function_declaration name: (_) @run @_name
(#match? @_name "^Example.*"))
) @_
(#set! tag go-example)
)
; Functions names start with `Benchmark`
(
(