Skip to content

bakins/envexpvar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

envexpvar

Expose Process Environment via expvar in Go.

GoDocCircleCI

Usage:

In your go code simply:

import _ "github.com/bakins/envexpvar"

And environments variables will be exposed using expvar. Generally these are exposed on an http endpoint. See the docs for expvar

An extremely simple example is included in bin/example/example.go. Run this:

cd bin/example
go run example.go

And then request /debug/vars on port 8080 and you will see "environment" included.

$ curl http://localhost:8080/debug/vars
{
"cmdline": ["/var/folders/zs/9j117pqx0c91dy_djv0pk5pc0000gn/T/go-build911455735/command-line-arguments/_obj/exe/example"],
"environment": {"
...

LICENSE

See LICENSE

About

Expose Process Environment via expvar in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published