/expvar

A expvar handler with pretty output format for gin framework, expvar provides a standardized interface to public variables.

Primary LanguageGoMIT LicenseMIT

expvar

Run Tests codecov Go Report Card GoDoc

A expvar handler with pretty output format for gin framework, expvar provides a standardized interface to public variables.

Usage

Start using it

Download and install it:

go get github.com/elliotxx/expvar

Import it in your code:

import "github.com/elliotxx/expvar"

Canonical example

package main

import (
  "log"

  "github.com/elliotxx/expvar"
  "github.com/gin-gonic/gin"
)

func main() {
  r := gin.Default()

  r.GET("/debug/vars", expvar.Handler())

  if err := r.Run(":8080"); err != nil {
    log.Fatal(err)
  }
}

Screenshot