Skip to content

Commit

Permalink
Merge pull request #1 from ejdem86/ejdem/implement_middleware_termina…
Browse files Browse the repository at this point in the history
…tion

allows the middleware to break execution
  • Loading branch information
ejdem86 authored Nov 20, 2019
2 parents 333399a + 8be581f commit 97e9fa9
Show file tree
Hide file tree
Showing 8 changed files with 160 additions and 31 deletions.
79 changes: 53 additions & 26 deletions api.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,13 @@ type resource struct {
}

// middlewareChain executes the middleeware chain setup
func (api *API) middlewareChain(c APIContexter, w http.ResponseWriter, r *http.Request) {
func (api *API) middlewareChain(c APIContexter, w http.ResponseWriter, r *http.Request) error {
for _, middleware := range api.middlewares {
middleware(c, w, r)
if err := middleware(c, w, r); err != nil {
return err
}
}
return nil
}

// allocateContext creates a context for the api.contextPool, saving allocations
Expand Down Expand Up @@ -252,31 +255,35 @@ func (api *API) addResource(prototype jsonapi.MarshalIdentifier, source interfac

api.router.Handle("OPTIONS", baseURL, func(w http.ResponseWriter, r *http.Request, _ map[string]string, context map[string]interface{}) {
c := api.contextPool.Get().(APIContexter)
defer api.contextPool.Put(c)
c.Reset()

for key, val := range context {
c.Set(key, val)
}

api.middlewareChain(c, w, r)
if err := api.middlewareChain(c, w, r); err != nil {
return
}
w.Header().Set("Allow", strings.Join(getAllowedMethods(source, true), ","))
w.WriteHeader(http.StatusNoContent)
api.contextPool.Put(c)
})

api.router.Handle("GET", baseURL, func(w http.ResponseWriter, r *http.Request, _ map[string]string, context map[string]interface{}) {
info := requestInfo(r, api)
c := api.contextPool.Get().(APIContexter)
defer api.contextPool.Put(c)
c.Reset()

for key, val := range context {
c.Set(key, val)
}

api.middlewareChain(c, w, r)
if err := api.middlewareChain(c, w, r); err != nil {
return
}

err := res.handleIndex(c, w, r, *info)
api.contextPool.Put(c)
if err != nil {
handleError(err, w, r, api.ContentType)
}
Expand All @@ -285,30 +292,34 @@ func (api *API) addResource(prototype jsonapi.MarshalIdentifier, source interfac
if _, ok := source.(ResourceGetter); ok {
api.router.Handle("OPTIONS", baseURL+"/:id", func(w http.ResponseWriter, r *http.Request, _ map[string]string, context map[string]interface{}) {
c := api.contextPool.Get().(APIContexter)
defer api.contextPool.Put(c)
c.Reset()

for key, val := range context {
c.Set(key, val)
}

api.middlewareChain(c, w, r)
if err := api.middlewareChain(c, w, r); err != nil {
return
}
w.Header().Set("Allow", strings.Join(getAllowedMethods(source, false), ","))
w.WriteHeader(http.StatusNoContent)
api.contextPool.Put(c)
})

api.router.Handle("GET", baseURL+"/:id", func(w http.ResponseWriter, r *http.Request, params map[string]string, context map[string]interface{}) {
info := requestInfo(r, api)
c := api.contextPool.Get().(APIContexter)
defer api.contextPool.Put(c)
c.Reset()

for key, val := range context {
c.Set(key, val)
}

api.middlewareChain(c, w, r)
if err := api.middlewareChain(c, w, r); err != nil {
return
}
err := res.handleRead(c, w, r, params, *info)
api.contextPool.Put(c)
if err != nil {
handleError(err, w, r, api.ContentType)
}
Expand All @@ -324,15 +335,17 @@ func (api *API) addResource(prototype jsonapi.MarshalIdentifier, source interfac
return func(w http.ResponseWriter, r *http.Request, params map[string]string, context map[string]interface{}) {
info := requestInfo(r, api)
c := api.contextPool.Get().(APIContexter)
defer api.contextPool.Put(c)
c.Reset()

for key, val := range context {
c.Set(key, val)
}

api.middlewareChain(c, w, r)
if err := api.middlewareChain(c, w, r); err != nil {
return
}
err := res.handleReadRelation(c, w, r, params, *info, relation)
api.contextPool.Put(c)
if err != nil {
handleError(err, w, r, api.ContentType)
}
Expand All @@ -343,15 +356,17 @@ func (api *API) addResource(prototype jsonapi.MarshalIdentifier, source interfac
return func(w http.ResponseWriter, r *http.Request, params map[string]string, context map[string]interface{}) {
info := requestInfo(r, api)
c := api.contextPool.Get().(APIContexter)
defer api.contextPool.Put(c)
c.Reset()

for key, val := range context {
c.Set(key, val)
}

api.middlewareChain(c, w, r)
if err := api.middlewareChain(c, w, r); err != nil {
return
}
err := res.handleLinked(c, api, w, r, params, relation, *info)
api.contextPool.Put(c)
if err != nil {
handleError(err, w, r, api.ContentType)
}
Expand All @@ -361,15 +376,17 @@ func (api *API) addResource(prototype jsonapi.MarshalIdentifier, source interfac
api.router.Handle("PATCH", baseURL+"/:id/relationships/"+relation.Name, func(relation jsonapi.Reference) routing.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request, params map[string]string, context map[string]interface{}) {
c := api.contextPool.Get().(APIContexter)
defer api.contextPool.Put(c)
c.Reset()

for key, val := range context {
c.Set(key, val)
}

api.middlewareChain(c, w, r)
if err := api.middlewareChain(c, w, r); err != nil {
return
}
err := res.handleReplaceRelation(c, w, r, params, relation)
api.contextPool.Put(c)
if err != nil {
handleError(err, w, r, api.ContentType)
}
Expand All @@ -381,15 +398,17 @@ func (api *API) addResource(prototype jsonapi.MarshalIdentifier, source interfac
api.router.Handle("POST", baseURL+"/:id/relationships/"+relation.Name, func(relation jsonapi.Reference) routing.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request, params map[string]string, context map[string]interface{}) {
c := api.contextPool.Get().(APIContexter)
defer api.contextPool.Put(c)
c.Reset()

for key, val := range context {
c.Set(key, val)
}

api.middlewareChain(c, w, r)
if err := api.middlewareChain(c, w, r); err != nil {
return
}
err := res.handleAddToManyRelation(c, w, r, params, relation)
api.contextPool.Put(c)
if err != nil {
handleError(err, w, r, api.ContentType)
}
Expand All @@ -399,15 +418,17 @@ func (api *API) addResource(prototype jsonapi.MarshalIdentifier, source interfac
api.router.Handle("DELETE", baseURL+"/:id/relationships/"+relation.Name, func(relation jsonapi.Reference) routing.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request, params map[string]string, context map[string]interface{}) {
c := api.contextPool.Get().(APIContexter)
defer api.contextPool.Put(c)
c.Reset()

for key, val := range context {
c.Set(key, val)
}

api.middlewareChain(c, w, r)
if err := api.middlewareChain(c, w, r); err != nil {
return
}
err := res.handleDeleteToManyRelation(c, w, r, params, relation)
api.contextPool.Put(c)
if err != nil {
handleError(err, w, r, api.ContentType)
}
Expand All @@ -421,15 +442,17 @@ func (api *API) addResource(prototype jsonapi.MarshalIdentifier, source interfac
api.router.Handle("POST", baseURL, func(w http.ResponseWriter, r *http.Request, params map[string]string, context map[string]interface{}) {
info := requestInfo(r, api)
c := api.contextPool.Get().(APIContexter)
defer api.contextPool.Put(c)
c.Reset()

for key, val := range context {
c.Set(key, val)
}

api.middlewareChain(c, w, r)
if err := api.middlewareChain(c, w, r); err != nil {
return
}
err := res.handleCreate(c, w, r, info.prefix, *info)
api.contextPool.Put(c)
if err != nil {
handleError(err, w, r, api.ContentType)
}
Expand All @@ -439,15 +462,17 @@ func (api *API) addResource(prototype jsonapi.MarshalIdentifier, source interfac
if _, ok := source.(ResourceDeleter); ok {
api.router.Handle("DELETE", baseURL+"/:id", func(w http.ResponseWriter, r *http.Request, params map[string]string, context map[string]interface{}) {
c := api.contextPool.Get().(APIContexter)
defer api.contextPool.Put(c)
c.Reset()

for key, val := range context {
c.Set(key, val)
}

api.middlewareChain(c, w, r)
if err := api.middlewareChain(c, w, r); err != nil {
return
}
err := res.handleDelete(c, w, r, params)
api.contextPool.Put(c)
if err != nil {
handleError(err, w, r, api.ContentType)
}
Expand All @@ -458,15 +483,17 @@ func (api *API) addResource(prototype jsonapi.MarshalIdentifier, source interfac
api.router.Handle("PATCH", baseURL+"/:id", func(w http.ResponseWriter, r *http.Request, params map[string]string, context map[string]interface{}) {
info := requestInfo(r, api)
c := api.contextPool.Get().(APIContexter)
defer api.contextPool.Put(c)
c.Reset()

for key, val := range context {
c.Set(key, val)
}

api.middlewareChain(c, w, r)
if err := api.middlewareChain(c, w, r); err != nil {
return
}
err := res.handleUpdate(c, w, r, params, *info)
api.contextPool.Put(c)
if err != nil {
handleError(err, w, r, api.ContentType)
}
Expand Down
2 changes: 1 addition & 1 deletion api_public.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

// HandlerFunc for api2go middlewares
type HandlerFunc func(APIContexter, http.ResponseWriter, *http.Request)
type HandlerFunc func(APIContexter, http.ResponseWriter, *http.Request) error

// API is a REST JSONAPI.
type API struct {
Expand Down
3 changes: 2 additions & 1 deletion api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1460,8 +1460,9 @@ var _ = Describe("RestHandler", func() {

api = NewAPIWithRouting(testPrefix, NewStaticResolver(""), newTestRouter())
api.AddResource(Post{}, source)
MiddleTest := func(c APIContexter, w http.ResponseWriter, r *http.Request) {
MiddleTest := func(c APIContexter, w http.ResponseWriter, r *http.Request) error {
w.Header().Add("x-test", "test123")
return nil
}
api.UseMiddleware(MiddleTest)
rec = httptest.NewRecorder()
Expand Down
16 changes: 16 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module github.com/ejdem86/api2go

go 1.13

require (
github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813
github.com/gin-gonic/gin v1.4.0
github.com/gorilla/mux v1.7.3
github.com/julienschmidt/httprouter v1.3.0
github.com/labstack/echo v3.3.10+incompatible
github.com/labstack/gommon v0.3.0 // indirect
github.com/onsi/ginkgo v1.10.3
github.com/onsi/gomega v1.7.1
gopkg.in/guregu/null.v2 v2.1.2
gopkg.in/guregu/null.v3 v3.4.0
)
85 changes: 85 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813 h1:Uc+IZ7gYqAf/rSGFplbWBSHaGolEQlNLgMgSE3ccnIQ=
github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813/go.mod h1:P+oSoE9yhSRvsmYyZsshflcR6ePWYLql6UU1amW13IM=
github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3 h1:t8FVkw33L+wilf2QiWkw0UV77qRpcH/JHPKGpKa2E8g=
github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s=
github.com/gin-gonic/gin v1.4.0 h1:3tMoCCfM7ppqsR0ptz/wi1impNpT7/9wQtMZ8lr1mCQ=
github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw=
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/json-iterator/go v1.1.6 h1:MrUvLMLTMxbqFJ9kzlvat/rYZqZnW3u4wkLzWTaFwKs=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U=
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/labstack/echo v3.3.10+incompatible h1:pGRcYk231ExFAyoAjAfD85kQzRJCRI8bbnE7CX5OEgg=
github.com/labstack/echo v3.3.10+incompatible/go.mod h1:0INS7j/VjnFxD4E2wkz67b8cVwCLbBmJyDaka6Cmk1s=
github.com/labstack/gommon v0.3.0 h1:JEeO0bvc78PKdyHxloTKiF8BD5iGrH8T6MSeGvSgob0=
github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k=
github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU=
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-isatty v0.0.7 h1:UvyT9uN+3r7yLEYSlJsbQGdsaB/a0DlgWP3pql6iwOc=
github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.9 h1:d5US/mDsogSGW37IV293h//ZFaeajb69h+EHFsv2xGg=
github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.10.3 h1:OoxbjfXVZyod1fmWYhI7SEyaD8B00ynP3T+D5GiyHOY=
github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/gomega v1.7.1 h1:K0jcRCwNQM3vFGh1ppMtDh/+7ApJrjldlX8fA0jDTLQ=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/ugorji/go v1.1.4 h1:j4s+tAvLfL3bZyefP2SEWmhBzmuIlH/eqNuPdFPgngw=
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasttemplate v1.0.1 h1:tY9CJiPnMXf1ERmG2EyK7gNUd+c6RKGD0IfU8WdUSz8=
github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c h1:uOCk1iQW6Vc18bnC13MfzScl+wdKBmM9Y9kU7Z83/lw=
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 h1:DH4skfRX4EBpamg7iV4ZlCpblAHI6s6TDM39bFZumv8=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a h1:aYOabOQFp6Vj6W1F80affTUvO9UxmJRx8K0gsfABByQ=
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM=
gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE=
gopkg.in/go-playground/validator.v8 v8.18.2 h1:lFB4DoMU6B626w8ny76MV7VX6W2VHct2GVOI3xgiMrQ=
gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y=
gopkg.in/guregu/null.v2 v2.1.2 h1:YOuepWdYqGnrenzPyMi+ybCjeDzjdazynbwsXXOk4i8=
gopkg.in/guregu/null.v2 v2.1.2/go.mod h1:XORrx8tyS5ZDcyUboCIxQtta/Aujk/6pfWrn9Xe33mU=
gopkg.in/guregu/null.v3 v3.4.0 h1:AOpMtZ85uElRhQjEDsFx21BkXqFPwA7uoJukd4KErIs=
gopkg.in/guregu/null.v3 v3.4.0/go.mod h1:E4tX2Qe3h7QdL+uZ3a0vqvYwKQsRSQKM5V4YltdgH9Y=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
2 changes: 1 addition & 1 deletion jsonapi/fixtures_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strconv"
"time"

"gopkg.in/guregu/null.v2/zero"
"gopkg.in/guregu/null.v3/zero"
)

type Magic struct {
Expand Down
2 changes: 1 addition & 1 deletion jsonapi/marshal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"database/sql"
"time"

"gopkg.in/guregu/null.v2/zero"
"gopkg.in/guregu/null.v3/zero"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
Expand Down
Loading

0 comments on commit 97e9fa9

Please sign in to comment.