samber / samber/oops

Can you add LastPublic(), LastCode() API?

Open
#34 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
990
Forks
45
Avg merge
5d 9h
Merged PRs (30d)
5

Description

I noticed that when calling Public(), Code(), the deepest public/code value will be obtained, but the business often overwrites the bottom layer information, and the top layer information is needed in the final output.

When I handle errors, I usually recursively obtain stack information. The current API does not allow me to obtain error information at each layer.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing Public() and Code() implementations and tracing how recursive error information is traversed. Add LastPublic() and LastCode() with behavior that exposes the top-layer values while preserving the current deepest-value APIs, then run the relevant error-handling tests and verify both traversal cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend-api-design
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.