Categorygithub.com/pschlump/dbgo
modulepackage
1.0.9
Repository: https://github.com/pschlump/dbgo.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"

		"git.q8s.co/pschlump/dbgo"
	)

	func main() {
		dbgo.Printf("I am at: %(LF), data %(J)\n", []string{1,2,3})
	}

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

I will add complete documentation tomorrow.

Formats:

FormatDescription
%(LF)print out line number
%(j)convert data using json.Encode and output with indentation
%(J)convert data using json.Encode and output

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
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
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.
InArray returns the subscript if the string 's' is found in the array 'arr', else -1.
Return 0..n if 'n' is in the array arr, else -1.
Return 0..n if 's' is in the array arr, else -1.
No description provided by the author
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
No description provided by the author
No description provided by the author
No description provided by the author
StdErrPiped returns true if os.Stderr apears to be send to a pipe.
StdErrPiped returns true if os.Stdin apears to be send to a pipe.
StdErrPiped returns true if os.Stdout apears to be send to a pipe.
SVar return the JSON encoded version of the data.
SVarI return the JSON encoded version of the data with tab indentation.
Hm...

# Variables

Black.
Blue.
No description provided by the author
Cyan.
Green.
No description provided by the author
Magenta.
No description provided by the author
Red.
Reset to default color.
No description provided by the author
No description provided by the author
Yellow.

# Structs

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

# Interfaces

No description provided by the author

# Type aliases

No description provided by the author