[Go] [Breaking Change] `Define*` functions should return concrete type instead of interface
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.5k
- Forks
- 845
- Avg merge
- 4d 4h
- Merged PRs (30d)
- 58
Description
Describe the bug
Returning concrete types means callers will always have access to new methods exposed on it. Returning an interface means that adding a new function to it technically means it is a breaking change as users will not have it implemented in mocks, etc. Registry will continue to have to return interfaces on lookup.
This means that common interfaces ai.Tool, ai.Model, etc should be moved to the api subpackage.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the Go Define* functions and the common ai.Tool and ai.Model interfaces, then inspect how the api subpackage and registry lookups are structured. Determine the concrete return types and the interface placement needed for the breaking change; done means definitions expose concrete types while registry lookups continue returning interfaces.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100