stack

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2023 License: BSD-3-Clause Imports: 2 Imported by: 1

README

Stack

Stack is package to do operation on debug stack. This package should be used to reduce unimportant stack trace. Smaller stack trace helps to debug trace the error faster.

Warning

This package doesn't work when imported as vendor!

You should copy the code to each repository and modify:

var (
    // replace with the path where you place the code
    functionPackageKeyword = []byte("/github.com/rizalgowandy/gdk/pkg/stack/")
)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToArr

func ToArr(stack []byte) []string

ToArr split stack trace by newline. Only trim all characters before company keyword.

Example: Input => /home/rizalgowandy/go/src/github.com/rizalgowandy/gdk/pkg/stack.go 130 Result => gdk/pkg/stack.go 130

func Trim

func Trim(stack []byte) []byte

Trim removes unnecessary stack trace. Only take stack trace with current company keyword. Also, excludes lines with function package keyword.

Types

This section is empty.

Jump to

Keyboard shortcuts

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