Summary
Extend Go scanner to handle receiver methods and Go generics, enabling full support for modern Go codebases.
Background
Part of Epic #128: Go Language Support
Depends on: #129 (Core Go Scanner)
Tasks
Method Extraction
Generics Support
Go Doc Comments
Technical Notes
Metadata Schema Extension:
interface GoMetadata extends BaseMetadata {
receiver?: string; // "Server" for method receivers
receiverPointer?: boolean; // true for *Server
isGeneric?: boolean; // true for generic functions/types
typeParameters?: string[]; // ["T any", "K comparable"]
}
Example Extractions:
Input:
// ExpBackoff helps implement exponential backoff.
type ExpBackoff struct {
conf *ExpBackoffConf
}
// MarkFailAndGetWait returns wait duration after failure.
func (e *ExpBackoff) MarkFailAndGetWait() time.Duration {
e.numFailures++
return e.GetWaitFromFailures(e.numFailures)
}
func TopK[T any](k int, target Embedding[T]) ([]T, error) {
// ...
}
Output metadata for method:
{
"name": "ExpBackoff.MarkFailAndGetWait",
"type": "method",
"receiver": "ExpBackoff",
"receiverPointer": true,
"signature": "func (e *ExpBackoff) MarkFailAndGetWait() time.Duration",
"docstring": "MarkFailAndGetWait returns wait duration after failure."
}
Acceptance Criteria
References
Summary
Extend Go scanner to handle receiver methods and Go generics, enabling full support for modern Go codebases.
Background
Part of Epic #128: Go Language Support
Depends on: #129 (Core Go Scanner)
Tasks
Method Extraction
func (s *Server) Start()receiver: "Server"receiverPointer: trueGenerics Support
func TopK[T any](...)type Embedding[T any] structtypeParameters: ["T any"]isGeneric: trueGo Doc Comments
docstringmetadata fieldTechnical Notes
Metadata Schema Extension:
Example Extractions:
Input:
Output metadata for method:
{ "name": "ExpBackoff.MarkFailAndGetWait", "type": "method", "receiver": "ExpBackoff", "receiverPointer": true, "signature": "func (e *ExpBackoff) MarkFailAndGetWait() time.Duration", "docstring": "MarkFailAndGetWait returns wait duration after failure." }Acceptance Criteria
References