~sircmpwn/chartsrv-devel

Error out instead of crashing when server isn't specified v1 PROPOSED

Noam Preil: 1
 Error out instead of crashing when server isn't specified

 1 files changed, 4 insertions(+), 0 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/chartsrv-devel/patches/14063/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH] Error out instead of crashing when server isn't specified Export this patch

---
 main.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/main.go b/main.go
index e15d079..887ae50 100644
--- a/main.go
+++ b/main.go
@@ -128,6 +128,10 @@ func metricName(metric map[string]string) string {
func main() {
	plotutil.DefaultDashes = [][]vg.Length{{}}

	if len(os.Args) < 2 {
		fmt.Printf("Usage: %s server\n", os.Args[0])
		os.Exit(1)
	}
	upstream = os.Args[1]
	router := chi.NewRouter()
	router.Use(middleware.RealIP)
-- 
2.28.0
Thanks!

To git@git.sr.ht:~sircmpwn/chartsrv
   e0436f2..d5eacb2  master -> master