Categorygithub.com/pschlump/godebug
modulepackage
1.0.7
Repository: https://github.com/pschlump/godebug.git
Documentation: pkg.go.dev

# README

godebug

license

Small library of tools for debugging Go (golang) programs.

The most useful of these is LF(). It returns a line number and file name. The parameter is an optional number. 1 indicates that you want it for the current call. 2 would be the parent of the current call.

Example:


	package main

	import (
		"fmt"

		"github.com/pschlump/godebug"
	)

	func main() {
		fmt.Printf("I am at: %s\n", godebug.LF())
	}

LF() takes an optional parameter, 1 indicates the current function, 2 is the parent, 3 the grandparent.

I will add complete documentation tomorrow.

ChkEnv

Return true if the passed environment variable can be parsed to be a true value. Values are cached so that the os.Getenv is only called once for each variable.

There is a test in ./test/test.sh to test this (or use the Makefile).

# Packages

No description provided by the author
No description provided by the author

# Functions

No description provided by the author
Printf with a true false flag.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
FILE Returns the current file name.
No description provided by the author
FUNCNAME returns the current function name as a string.
IAmAt print out the current Function,File,Line No and an optional set of strings.
IAmAt2 prints out the current Function,File,Line No and an optional set of strings - do this for 2 levels deep.
Return 0..n if 'n' is in the array arr, else -1.
Return 0..n if 's' is in the array arr, else -1.
LF Returns the File name and Line no as a string.
LF2 returns the line/file for the parent.
LFj returns the File name and Line no as a string.
LINE Return the current line number as a string.
LINEnf Returns line number, 0 if error.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
SVar return the JSON encoded version of the data.
SVarI return the JSON encoded version of the data with tab indentation.
Hm...

# Variables

No description provided by the author