feat(golang): Go function and method declaration parsing (PR-03)#522
Merged
Conversation
SafeDep Report SummaryNo dependency changes detected. Nothing to scan. This report is generated by SafeDep Github App |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #522 +/- ##
==========================================
+ Coverage 82.83% 82.93% +0.09%
==========================================
Files 124 125 +1
Lines 14462 14540 +78
==========================================
+ Hits 11980 12059 +79
+ Misses 2030 2027 -3
- Partials 452 454 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
8 tasks
Owner
Author
This was referenced Feb 15, 2026
Owner
Author
Merge activity
|
Parse Go function declarations, method declarations (with receivers), and init() functions into CodeGraph nodes. These are the primary symbols that the call graph builder indexes. New golang package types: - FunctionInfo: holds name, params, return type, visibility, init flag - MethodInfo: embeds FunctionInfo + receiver type (pointer stripped) Dispatcher functions in parser_golang.go: - parseGoFunctionDeclaration: creates function_declaration or init_function nodes - parseGoMethodDeclaration: creates method nodes with Interface=[receiverType] Both set SourceLocation, Modifier (public/private), and isGoSourceFile on every node. Resolves PR-02 lint failures (setGoSourceLocation and isGoSourceFile now used). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2e1dc04 to
e4d94c8
Compare
Code Pathfinder Security ScanNo security issues detected.
Powered by Code Pathfinder |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Summary
setGoSourceLocationandisGoSourceFilenow usedTest plan
func Foo(a, b int) string {}→ correct Node with params, return type, Modifier="public"func foo() {}→ Node{Modifier: "private"}func init() {}→ Node{Type: "init_function"}func Printf(format string, args ...interface{}) {}→ variadic params handledfunc Read(p []byte) (int, error) {}→ multiple return typesfunc (s *Server) Start() error {}→ Node{Type: "method", Interface: ["S"]}func (s Server) String() string {}→ value receiver, same resultfunc (s *S) stop() {}→ Node{Modifier: "private"}method_declarationregression: still works with isJavaSourceFile guardgo build ./...compiles without errorsgo test ./graph/golang/...— 100% coverage on declarations.gogo test ./graph/...— no regressionsgo vet ./...reports zero findings🤖 Generated with Claude Code