Skip to content

Instantly share code, notes, and snippets.

@rsperl
Last active July 25, 2022 16:06
Show Gist options
  • Save rsperl/ebc356e01b1372a4f681c9fc289b5b9f to your computer and use it in GitHub Desktop.
Save rsperl/ebc356e01b1372a4f681c9fc289b5b9f to your computer and use it in GitHub Desktop.
monitor debug vars #go #snippet
package main
import (
_ "expvar"
"fmt"
"net/http"
"os"
)
// use expvarmon to monitor:
// https://github.com/divan/expvarmon
// expvarmon -ports=<port>
func init() {
port := os.Getenv("EXPVARPORT")
if port != "" {
go http.ListenAndServe(":", nil)
}
}
func main() {
fmt.Println("vim-go")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment