funcname

package
v1.1.17 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package funcname menurunkan nama span/metric "<Struct>.<Func>" dari fungsi pemanggil saat runtime, supaya nama tidak perlu ditulis hardcode.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Caller

func Caller(skip int) string

Caller mengembalikan nama fungsi pada kedalaman stack skip: skip=0 → fungsi yang memanggil Caller, skip=1 → pemanggilnya, dst. Hasil di-cache per call site, sehingga parsing hanya terjadi sekali per lokasi kode.

func Format

func Format(full string) string

Format mengubah nama fungsi Go lengkap menjadi "<Struct>.<Func>" atau "<pkg>.<Func>" untuk fungsi tanpa receiver.

mks/app/usecases.(*orderNotarisUsecase).CreateOrderNotaris → OrderNotarisUsecase.CreateOrderNotaris
mks/app/usecases.(*orderNotarisUsecase).CreateOrderNotaris.func1 → OrderNotarisUsecase.CreateOrderNotaris
mks/app/repo.(*Repo[...]).Get → Repo.Get
mks/app/jobs.(*PencairanNotarisJob).Handle → PencairanNotarisJob.Handle
mks/app/util.FormatDate → util.FormatDate

func RegisterTypeName

func RegisterTypeName(goName, display string)

RegisterTypeName mengatur nama tampil untuk tipe receiver, mis. untuk akronim yang tidak bisa ditebak: RegisterTypeName("glDebitUsecase", "GLDebitUsecase"). Panggil saat init/boot, sebelum span pertama dibuat.

Types

This section is empty.

Jump to

Keyboard shortcuts

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