From d272cafd2e61f2e0b39f6cf55ca871a38a73f492 Mon Sep 17 00:00:00 2001 From: Christopher Ramey Date: Thu, 26 Dec 2019 16:25:16 -0900 Subject: [PATCH] fixed api bug where empty fields weren't being omitted --- .gitignore | 1 + pages/api.go | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 004f1a0..f0c780c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *.swp qurl +qurl.db diff --git a/pages/api.go b/pages/api.go index 44d3cf3..b51f2a1 100644 --- a/pages/api.go +++ b/pages/api.go @@ -11,9 +11,9 @@ import ( ) type apijson struct { - URL string `json:"url",omitempty` - Exists bool `json:"exists",omitempty` - Error string `json:"error",omitempty` + URL string `json:"url,omitempty"` + Exists bool `json:"exists,omitempty"` + Error string `json:"error,omitempty"` } func (ctx *RootHandler) ServeAPI(w http.ResponseWriter, r *http.Request) {