From 9c2ad91230d72fe6d661450cc78300ea223ae2bc Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Mon, 19 Oct 2020 11:05:36 +0530 Subject: make it better --- vendor/github.com/gin-gonic/gin/render/data.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 vendor/github.com/gin-gonic/gin/render/data.go (limited to 'vendor/github.com/gin-gonic/gin/render/data.go') diff --git a/vendor/github.com/gin-gonic/gin/render/data.go b/vendor/github.com/gin-gonic/gin/render/data.go new file mode 100644 index 0000000..efa75d5 --- /dev/null +++ b/vendor/github.com/gin-gonic/gin/render/data.go @@ -0,0 +1,20 @@ +// Copyright 2014 Manu Martinez-Almeida. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package render + +import "net/http" + +type Data struct { + ContentType string + Data []byte +} + +func (r Data) Render(w http.ResponseWriter) error { + if len(r.ContentType) > 0 { + w.Header()["Content-Type"] = []string{r.ContentType} + } + w.Write(r.Data) + return nil +} -- cgit v1.2.3