dbg

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallerInfo

func CallerInfo() string

CallerInfo retrieves and formats the file name and line number of the caller's location in the source code.

It uses the runtime.Caller function to determine the caller's file and line information.

Example usage:

callerInfo := CallerInfo()
fmt.Println("Caller:", callerInfo)

The output will look like this:

Caller: [filename:line]

Where "filename" is the name of the file where the caller is located, and "line" is the line number in that file.

func Dbg

func Dbg(exp any)

Dbg is a debugging utility function that prints the given expression and its location in the source code to standard output. It also prints the file name and line number where the Dbg function is called.

Parameters:

exp  - The expression or value to be printed.

Example:

Dbg(someValue)

The output will look like this:

[filename:line] variable = value

Where "filename" is the name of the file where Dbg is called, "line" is the line number in that file, "variable" is the variable or expression being debugged, and "value" is the value of the expression.

Types

This section is empty.

Jump to

Keyboard shortcuts

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