filer: add API to add/modify/delete tagging

This commit is contained in:
Chris Lu
2020-11-09 01:00:07 -08:00
parent 4f676aa7d3
commit 6856b0d57e
3 changed files with 118 additions and 6 deletions

View File

@@ -38,10 +38,12 @@ func init() {
func writeJson(w http.ResponseWriter, r *http.Request, httpStatus int, obj interface{}) (err error) {
var bytes []byte
if r.FormValue("pretty") != "" {
bytes, err = json.MarshalIndent(obj, "", " ")
} else {
bytes, err = json.Marshal(obj)
if obj != nil {
if r.FormValue("pretty") != "" {
bytes, err = json.MarshalIndent(obj, "", " ")
} else {
bytes, err = json.Marshal(obj)
}
}
if err != nil {
return