From 7adf74ffd44994d48d7502d1340c69cd19dbfbb7 Mon Sep 17 00:00:00 2001 From: Dan Sosedoff Date: Fri, 10 Oct 2014 00:28:33 -0500 Subject: [PATCH] Tweaks --- main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 8ef7dfd..005744a 100644 --- a/main.go +++ b/main.go @@ -45,7 +45,7 @@ var options struct { Static string `short:"s" description:"Path to static assets" default:"./static"` } -func formatResult(res *Result) []map[string]interface{} { +func (res *Result) Format() []map[string]interface{} { var items []map[string]interface{} for _, row := range res.Rows { @@ -176,7 +176,7 @@ func API_GetTable(c *gin.Context) { return } - c.JSON(200, formatResult(res)) + c.JSON(200, res.Format()) } func API_History(c *gin.Context) { @@ -191,7 +191,7 @@ func API_Info(c *gin.Context) { return } - c.JSON(200, formatResult(res)[0]) + c.JSON(200, res.Format()[0]) } func API_HandleQuery(query string, c *gin.Context) {