diff --git a/src/docgen/detectors/go.py b/src/docgen/detectors/go.py index 5db4eea..0de41ea 100644 --- a/src/docgen/detectors/go.py +++ b/src/docgen/detectors/go.py @@ -1,10 +1,12 @@ +#!/usr/bin/env python3 """Go endpoint detector for Gin and chi.""" import re from pathlib import Path from typing import Optional -from docgen.models import Endpoint, HTTPMethod + from docgen.detectors.base import BaseDetector +from docgen.models import Endpoint, HTTPMethod class GoDetector(BaseDetector): @@ -19,7 +21,7 @@ class GoDetector(BaseDetector): ) GIN_HANDLE_PATTERN = re.compile( - r'(?:routers?|router)\s*\.\s*Handle\s*\("(GET|POST|PUT|PATCH|DELETE|OPTIONS|HEAD)"\s*,\s*"([^"]+)"', + r'(?:routers?|router)\s*\.\s*Handle\s*\(\s*"(GET|POST|PUT|PATCH|DELETE|OPTIONS|HEAD)"\s*,\s*"([^"]+)"', re.MULTILINE, )