; Go entry-point detection queries
; Captures: @node (declaration), @name (function name)

; func main()
(function_declaration
  name: (identifier) @name
  (#eq? @name "main")) @node

; func init()
(function_declaration
  name: (identifier) @name
  (#eq? @name "init")) @node

; http.HandleFunc / http.Handle
(call_expression
  function: (selector_expression
    operand: (identifier) @_pkg
    field: (field_identifier) @name
    (#eq? @_pkg "http")
    (#match? @name "^Handle"))) @node
