decorator

package
v3.8.1-rc.12 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FuncLog

func FuncLog(ctx context.Context) func()

FuncLog is a log print decorator. Correct usage is: defer decorator.FuncLog(ctx)()

func FuncLogSkip

func FuncLogSkip(ctx context.Context, skip int) func()

FuncLogSkip is a log print decorator. The argument skip is the number of stack frames to ascend. e.g.

func FuncName(ctx context.Context){
	   middleFunc(ctx)
}

func middleFunc(ctx context.Context){
    FuncLogSkip(ctx, 1)
    // ...
}

the funcName is `FuncName`

Types

This section is empty.

Jump to

Keyboard shortcuts

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