Skip to content

Commit

Permalink
Accept interface than map interface on JSEND
Browse files Browse the repository at this point in the history
  • Loading branch information
dynastymasra committed Apr 22, 2020
1 parent 490fa7f commit 3aae681
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jsend.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "encoding/json"
type JSend struct {
Status string `json:"status"`
Message string `json:"message,omitempty"`
Data *JSON `json:"data,omitempty"`
Data interface{} `json:"data,omitempty"`
Meta *Meta `json:"meta,omitempty"`
Code interface{} `json:"code,omitempty"`
}
Expand Down Expand Up @@ -53,7 +53,7 @@ func ErrorResponse(msg string, code interface{}) JSend {
}

// SuccessDataResponse used to return response JSON format if have data value
func SuccessDataResponse(data *JSON, meta *Meta) JSend {
func SuccessDataResponse(data interface{}, meta *Meta) JSend {
return JSend{Status: "success", Data: data, Meta: meta}
}

Expand Down

0 comments on commit 3aae681

Please sign in to comment.