Skip to content

proposal: runtime: CallerString #71519

@jimmyfrasche

Description

@jimmyfrasche

Proposal Details

This proposal is for a function with a signature like func CallerString(skip int) string.

It returns basic info about the caller in some fixed format.

Since it only returns info about a single frame and only reports it as simple data, when skip is a reasonable constant, it could be replaced at compile time as an optimization. Otherwise, it can be implemented in terms of Callers.

Either way, it would simplify common logging/monitoring/error annotating uses that just need a tiny bit of context about a single caller for reporting to a developer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    LibraryProposalIssues describing a requested change to the Go standard library or x/ libraries, but not to a toolProposal

    Type

    No type

    Projects

    Status

    Incoming

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions