diff --git a/core.go b/core.go index 967eaca..3c80602 100644 --- a/core.go +++ b/core.go @@ -104,7 +104,7 @@ func (app *App) Run(router *httprouter.Router) { // check if template engine is enable TemplateEnableStr := os.Getenv("TEMPLATE_ENABLE") - if "" == TemplateEnableStr { + if TemplateEnableStr == "" { TemplateEnableStr = "false" } TemplateEnable, _ := strconv.ParseBool(TemplateEnableStr) @@ -119,7 +119,7 @@ func (app *App) Run(router *httprouter.Router) { } useHttps, _ := strconv.ParseBool(useHttpsStr) - if "dev" == runMode { + if runMode == "dev" { fmt.Printf("Welcome to Goffee\n") if useHttps { fmt.Printf("Listening on https \nWaiting for requests...\n") diff --git a/response.go b/response.go index d6202c7..46f31ee 100644 --- a/response.go +++ b/response.go @@ -40,16 +40,6 @@ func (rs *Response) BufferFile(name string, filetype string, b bytes.Buffer) *Re return rs } -// writes the contents of a buffer to the HTTP response with specified file name and type if not terminated. -func (rs *Response) BufferInline(name string, filetype string, b bytes.Buffer) *Response { - - if rs.isTerminated == false { - rs.HttpResponseWriter.Header().Add("Content-Type", filetype) - b.WriteTo(rs.HttpResponseWriter) - } - return rs -} - // sets the response's content type to HTML and assigns the provided body as the response body if not terminated. func (rs *Response) Any(body any) *Response { if rs.isTerminated == false { diff --git a/template/components/content_table.go b/template/components/content_table.go index 5c6a21b..9e77908 100644 --- a/template/components/content_table.go +++ b/template/components/content_table.go @@ -15,7 +15,6 @@ type ContentTableTH struct { } type ContentTableTD struct { - ID string - Value interface{} // string or component struct according ValueType - ValueClass string + ID string + Value interface{} // string or component struct according ValueType } diff --git a/template/components/content_table.html b/template/components/content_table.html index 36f9b8b..e5aaf50 100644 --- a/template/components/content_table.html +++ b/template/components/content_table.html @@ -7,7 +7,7 @@
{{- range .AllTD}}