Given this type
type Response map[string]interface{}
I created a method NewResponse which fills in the default values:
func NewResponse() Response {
resp := Response{"status": 200, "msg": "Added jobs to queue"}
resp_metadata := make(map[string]string)
resp_metadata["base"] = "api/v1"
resp_metadata["self"] = "/crawler/jobs/add"
resp["metadata"] = resp_metadata
return resp
}
which i call like NewResponse()
but I would like to do Response.New()
instead, so the method signature should be like this
func (Response) New() Response {
but then I always get the error not enough arguments in call to Response.New
.
So, how could this be implemented?