Skip to content

Commit

Permalink
Add Go 1.8 to build matrix
Browse files Browse the repository at this point in the history
Also switch all uses of golang.org/x/net/context to use the context in the
standard library.
  • Loading branch information
kevinburke committed Feb 16, 2017
1 parent 87225a9 commit 009c383
Show file tree
Hide file tree
Showing 40 changed files with 45 additions and 64 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -3,6 +3,7 @@ go_import_path: github.com/saintpete/twilio-go

go:
- 1.7
- 1.8
- tip

before_script:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,9 @@
# Changes

## 0.57

Switch all imports to use the `"context"` library.

## 0.56

Use the new github.com/kevinburke/rest.DefaultTransport RoundTripper for
Expand Down
3 changes: 1 addition & 2 deletions accounts.go
@@ -1,9 +1,8 @@
package twilio

import (
"context"
"net/url"

"golang.org/x/net/context"
)

// This resource is a little special because the endpoint is GET
Expand Down
3 changes: 1 addition & 2 deletions accounts_test.go
@@ -1,12 +1,11 @@
package twilio

import (
"context"
"net/url"
"strconv"
"testing"
"time"

"golang.org/x/net/context"
)

func TestAccountGet(t *testing.T) {
Expand Down
3 changes: 1 addition & 2 deletions alerts.go
@@ -1,6 +1,7 @@
package twilio

import (
"context"
"encoding/json"
"fmt"
"net/url"
Expand All @@ -9,8 +10,6 @@ import (
"time"

types "github.com/kevinburke/go-types"

"golang.org/x/net/context"
)

const alertPathPart = "Alerts"
Expand Down
2 changes: 1 addition & 1 deletion alerts_example_test.go
@@ -1,12 +1,12 @@
package twilio_test

import (
"context"
"fmt"
"log"
"net/url"

twilio "github.com/saintpete/twilio-go"
"golang.org/x/net/context"
)

func ExampleAlertService_GetPage() {
Expand Down
3 changes: 1 addition & 2 deletions alerts_test.go
@@ -1,13 +1,12 @@
package twilio

import (
"context"
"encoding/json"
"fmt"
"net/url"
"testing"
"time"

"golang.org/x/net/context"
)

func TestGetAlert(t *testing.T) {
Expand Down
3 changes: 1 addition & 2 deletions applications.go
@@ -1,9 +1,8 @@
package twilio

import (
"context"
"net/url"

"golang.org/x/net/context"
)

const applicationPathPart = "Applications"
Expand Down
3 changes: 1 addition & 2 deletions applications_test.go
@@ -1,9 +1,8 @@
package twilio

import (
"context"
"testing"

"golang.org/x/net/context"
)

func TestApplicationGet(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion calls.go
@@ -1,13 +1,13 @@
package twilio

import (
"context"
"encoding/json"
"fmt"
"net/url"
"time"

types "github.com/kevinburke/go-types"
"golang.org/x/net/context"
)

const callsPathPart = "Calls"
Expand Down
3 changes: 1 addition & 2 deletions calls_test.go
@@ -1,11 +1,10 @@
package twilio

import (
"context"
"net/url"
"testing"
"time"

"golang.org/x/net/context"
)

func TestGetCall(t *testing.T) {
Expand Down
3 changes: 1 addition & 2 deletions conferences.go
@@ -1,13 +1,12 @@
package twilio

import (
"context"
"fmt"
"net/url"
"time"

types "github.com/kevinburke/go-types"

"golang.org/x/net/context"
)

const conferencePathPart = "Conferences"
Expand Down
3 changes: 1 addition & 2 deletions conferences_test.go
@@ -1,11 +1,10 @@
package twilio

import (
"context"
"net/url"
"testing"
"time"

"golang.org/x/net/context"
)

func TestGetConferencePage(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion example_messages_test.go
@@ -1,13 +1,13 @@
package twilio_test

import (
"context"
"fmt"
"log"
"net/url"
"time"

twilio "github.com/saintpete/twilio-go"
"golang.org/x/net/context"
)

func ExampleMessageService_GetMessagesInRange() {
Expand Down
2 changes: 1 addition & 1 deletion example_test.go
@@ -1,14 +1,14 @@
package twilio_test

import (
"context"
"fmt"
"log"
"net/url"
"time"

"github.com/kevinburke/rest"
twilio "github.com/saintpete/twilio-go"
"golang.org/x/net/context"
)

var callURL, _ = url.Parse("https://kev.inburke.com/zombo/zombocom.mp3")
Expand Down
2 changes: 1 addition & 1 deletion http.go
@@ -1,6 +1,7 @@
package twilio

import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
Expand All @@ -11,7 +12,6 @@ import (
"time"

"github.com/kevinburke/rest"
"golang.org/x/net/context"
)

// The twilio-go version. Run "make release" to bump this number.
Expand Down
3 changes: 1 addition & 2 deletions http_ctx.go
Expand Up @@ -3,9 +3,8 @@
package twilio

import (
"context"
"net/http"

"golang.org/x/net/context"
)

func withContext(r *http.Request, ctx context.Context) *http.Request {
Expand Down
3 changes: 3 additions & 0 deletions http_noctx.go
@@ -1,3 +1,6 @@
// Versions older than Go 1.7 are no longer supported, though this _may_ work
// for you.

// +build !go1.7

package twilio
Expand Down
2 changes: 1 addition & 1 deletion http_test.go
@@ -1,14 +1,14 @@
package twilio

import (
"context"
"net/http"
"net/http/httptest"
"strings"
"testing"
"time"

"github.com/kevinburke/rest"
"golang.org/x/net/context"
)

// invalid status here on purpose to check we use a different one.
Expand Down
3 changes: 1 addition & 2 deletions keys.go
@@ -1,9 +1,8 @@
package twilio

import (
"context"
"net/url"

"golang.org/x/net/context"
)

const keyPathPart = "Keys"
Expand Down
3 changes: 1 addition & 2 deletions media.go
Expand Up @@ -2,6 +2,7 @@ package twilio

import (
"bytes"
"context"
"errors"
"fmt"
"image"
Expand All @@ -15,8 +16,6 @@ import (
"net/url"
"os"
"strings"

"golang.org/x/net/context"
)

// A MediaService lets you retrieve a message's associated Media.
Expand Down
3 changes: 1 addition & 2 deletions media_test.go
@@ -1,13 +1,12 @@
package twilio

import (
"context"
"errors"
"os"
"strings"
"testing"
"time"

"golang.org/x/net/context"
)

func TestGetURL(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion messages.go
@@ -1,12 +1,12 @@
package twilio

import (
"context"
"fmt"
"net/url"
"time"

types "github.com/kevinburke/go-types"
"golang.org/x/net/context"
"golang.org/x/sync/errgroup"
)

Expand Down
3 changes: 1 addition & 2 deletions messages_test.go
@@ -1,15 +1,14 @@
package twilio

import (
"context"
"encoding/json"
"fmt"
"net/url"
"os"
"strings"
"testing"
"time"

"golang.org/x/net/context"
)

func TestGet(t *testing.T) {
Expand Down
3 changes: 1 addition & 2 deletions outgoingcallerids.go
@@ -1,9 +1,8 @@
package twilio

import (
"context"
"net/url"

"golang.org/x/net/context"
)

const callerIDPathPart = "OutgoingCallerIds"
Expand Down
3 changes: 1 addition & 2 deletions outgoingcallerids_test.go
@@ -1,10 +1,9 @@
package twilio

import (
"context"
"net/url"
"testing"

"golang.org/x/net/context"
)

func TestGetCallerID(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion page.go
@@ -1,13 +1,13 @@
package twilio

import (
"context"
"errors"
"net/url"
"strings"
"time"

types "github.com/kevinburke/go-types"
"golang.org/x/net/context"
)

type Page struct {
Expand Down
2 changes: 1 addition & 1 deletion phonenumbers.go
@@ -1,10 +1,10 @@
package twilio

import (
"context"
"net/url"

types "github.com/kevinburke/go-types"
"golang.org/x/net/context"
)

const numbersPathPart = "IncomingPhoneNumbers"
Expand Down
2 changes: 1 addition & 1 deletion phonenumbers_test.go
@@ -1,12 +1,12 @@
package twilio

import (
"context"
"net/url"
"testing"
"time"

"github.com/kevinburke/rest"
"golang.org/x/net/context"
)

func TestGetNumberPage(t *testing.T) {
Expand Down
3 changes: 1 addition & 2 deletions prices_messaging.go
@@ -1,9 +1,8 @@
package twilio

import (
"context"
"net/url"

"golang.org/x/net/context"
)

const messagingPathPart = "Messaging"
Expand Down

0 comments on commit 009c383

Please sign in to comment.