Skip to content

Add Go language detection#198

Open
riddhi2778 wants to merge 2 commits into
imDarshanGK:mainfrom
riddhi2778:issue-171-go-detection
Open

Add Go language detection#198
riddhi2778 wants to merge 2 commits into
imDarshanGK:mainfrom
riddhi2778:issue-171-go-detection

Conversation

@riddhi2778
Copy link
Copy Markdown

@riddhi2778 riddhi2778 commented May 21, 2026

Fixes #171

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor

Testing

  • I ran backend tests (pytest -q)
  • I tested frontend/API behavior manually

Checklist

  • Code is readable and beginner-friendly
  • No fake or placeholder behavior introduced
  • Documentation updated if needed

Overall Summary of Changes

  1. Added Go/Golang language hint mapping in code_assistant.py

    • Added "go": "Go" and "golang": "Go" so explicit language hints are correctly recognized.
  2. Added Go language detection patterns in LANG_SIGNATURES

    • Added Go-specific patterns like package main, func, defer, go, chan, :=, and range.
  3. Added Go test coverage in test_endpoints.py

    • Added GO_CODE sample with package, imports, functions, goroutines, and channels.
    • Added test_explanation_go() to verify Go language detection.
  4. Verified implementation manually

    • Tested /explanation/ endpoint through FastAPI docs.
    • API response correctly returns "language": "Go".

Implementation Screenshots

Attached below:

  • API response showing "language": "Go"
  • Test results screenshots
  • Running Backend
implemet 1 test test 2 backend

@imDarshanGK
Copy link
Copy Markdown
Owner

@riddhi2778 link the related issue number in the PR description (e.g., Fixes #issue_number) and include screenshots or implementation proof so the changes can be verified easily.

@riddhi2778
Copy link
Copy Markdown
Author

@imDarshanGK , I have updated my PR description along with the implementation screenshots. Do let me know, if any changes are required.

Copy link
Copy Markdown
Owner

@imDarshanGK imDarshanGK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@riddhi2778 Please link the related issue number in the PR description (e.g., Fixes #issue_number) and share implementation screenshots instead of code snippets.

@riddhi2778
Copy link
Copy Markdown
Author

okay, @imDarshanGK , give me some time, I am on it.

@riddhi2778
Copy link
Copy Markdown
Author

@imDarshanGK , I have added the implementation images along with the issue number in the updated PR. Do let me know if any changes are required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Go language detection to the explanation engine

2 participants