Skip to content

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

License

Notifications You must be signed in to change notification settings

gin-contrib/expvar

Folders and files

NameName
Last commit message
Last commit date
Apr 3, 2025
Jun 22, 2021
Mar 26, 2017
Apr 3, 2025
Aug 22, 2024
Dec 15, 2016
Aug 19, 2021
Jun 22, 2021
Sep 27, 2024
Apr 3, 2025
Apr 3, 2025

Repository files navigation

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)
  }
}