Skip to content

Latest commit

 

History

History
47 lines (32 loc) · 1.13 KB

README.md

File metadata and controls

47 lines (32 loc) · 1.13 KB

expvar

Run Tests codecov Go Report Card GoDoc

A expvar handler for gin framework, expvar provides a standardized interface to public variables.

Usage

Start using it

Download and install it:

go get github.com/gin-contrib/expvar

Import it in your code:

import "github.com/gin-contrib/expvar"

Canonical example

package main

import (
  "log"

  "github.com/gin-contrib/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)
  }
}