Skip to content

Commit 9ec7fc6

Browse files
authored
Merge pull request #275 from manyminds/context-package
Use context package from go 1.7
2 parents 8698a8c + 39925d9 commit 9ec7fc6

File tree

4 files changed

+3
-5
lines changed

4 files changed

+3
-5
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
language: go
22

33
go:
4-
- 1.6
54
- 1.7
65
- tip
76

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ query Paramter and only return comments that belong to it. In this example, retu
610610

611611
### Using middleware
612612
We provide a custom `APIContext` with
613-
a [context](https://godoc.org/golang.org/x/net/context) implementation that you
613+
a [context](https://godoc.org/context) implementation that you
614614
can use if you for example need to check if a user is properly authenticated
615615
before a request reaches the api2go routes.
616616

api_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ func (s *fixtureSource) Create(obj interface{}, req Request) (Responder, error)
313313
}
314314

315315
if p.Title == "" {
316-
err := NewHTTPError(errors.New("Bad request."), "Bad Request", http.StatusBadRequest)
316+
err := NewHTTPError(errors.New("Bad request"), "Bad Request", http.StatusBadRequest)
317317
err.Errors = append(err.Errors, Error{ID: "SomeErrorID", Source: &ErrorSource{Pointer: "Title"}})
318318
return &Response{}, err
319319
}

context.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
package api2go
22

33
import (
4+
"context"
45
"time"
5-
6-
"golang.org/x/net/context"
76
)
87

98
// APIContextAllocatorFunc to allow custom context implementations

0 commit comments

Comments
 (0)