Last active
July 25, 2022 16:06
-
-
Save rsperl/ebc356e01b1372a4f681c9fc289b5b9f to your computer and use it in GitHub Desktop.
monitor debug vars #go #snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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