debug

command module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

README

Debug for Golang

  • Go CI
  • codecov

Usage

If you want to use the Debug function, you need to add the following code to your project:

// Step 0: Import it
import "github.com/alibabacloud-go/debug/debug"

// Step 1: Initialize variables, you can replace flag with
var d = debug.Init("sdk")

// Step 2: Use it
func main() {
  d("this debug information just print when DEBUG environment variable was set")
}

Just run it with go run demo.go:

go run demo.go

No any results.

Set DEBUG environment variable with export DEBUG=sdk and run again:

$ DEBUG=sdk go run demo.go
this debug information just print when DEBUG environment variable was set

Testing

Run go test -v ./debug

License

The Apache License 2.0.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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