github.com/go-board/x-go@v0.1.2-0.20220610024734-db1323f6cb15/xdebug/gc.go (about)

     1  package xdebug
     2  
     3  import (
     4  	"net/http"
     5  	"runtime"
     6  )
     7  
     8  // gc is a http handler which will run runtime.GC when calling
     9  type gc struct{}
    10  
    11  func (gc) ServeHTTP(http.ResponseWriter, *http.Request) { runtime.GC() }
    12  
    13  // GcHandler return gc handler
    14  func GcHandler() http.Handler { return gc{} }