try 1
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func Message(status bool, message string) (map[string]interface{}) {
|
||||
return map[string]interface{} {"status" : status, "message" : message}
|
||||
}
|
||||
|
||||
func Respond(w http.ResponseWriter, data map[string] interface{}) {
|
||||
w.Header().Add("Content-Type", "application/json")
|
||||
json.NewEncoder(w).Encode(data)
|
||||
}
|
||||
Reference in New Issue
Block a user