runtimehelper

package module
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2026 License: MIT Imports: 3 Imported by: 2

README

runtimehelper

Go Reference Documentation

Helpers for Go's runtime package.

Documentation

Overview

Package runtimehelper contains runtime package helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallerCallerName

func CallerCallerName() string

CallerCallerName returns the name of the function that called the function that called CallerCallerName. In case of any failure an empty string is returned.

The //go:noinline pragma keeps CallerCallerName as its own stack frame so that the fixed skip count passed to NthCallerName stays correct.

func CallerName

func CallerName() string

CallerName returns the name of the function that called CallerName. In case of any failure an empty string is returned.

The //go:noinline pragma keeps CallerName as its own stack frame so that the fixed skip count passed to NthCallerName stays correct.

func JustFunctionName added in v0.4.0

func JustFunctionName(funcName string) string

JustFunctionName returns just the function name of the full function name (returned by Func.Name). If 'funcName' contains no package separator, it is returned (with generic type parameters stripped) unchanged.

func JustPackageFunctionName added in v0.4.0

func JustPackageFunctionName(funcName string) string

JustPackageFunctionName returns just the function name preceded with the package name of the full function name (returned by Func.Name). Generic type parameters (e.g. "[int]") are stripped from the result.

func NthCallerName added in v0.2.0

func NthCallerName(n int) string

NthCallerName returns the name of the n-th caller function of NthCallerName. In case of any failure an empty string is returned. For n's meaning see runtime.Caller documentation.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL