func PostsHandler(r render.Render, auth core.AuthData) { if auth.Check() { r.JSON(200, postsdb) } else { r.JSON(http.StatusUnauthorized, struct{ Error string }{"Not Authorized"}) } }