Switch to builtin "context" package now that we can assume Go 1.7

This commit is contained in:
Joachim Bauch 2020-08-31 13:58:28 +02:00
parent b7d5f2a639
commit 804e558e96
Failed to extract signature
20 changed files with 20 additions and 38 deletions

View file

@ -22,6 +22,7 @@
package main
import (
"context"
"encoding/json"
"fmt"
"log"
@ -42,8 +43,6 @@ import (
"github.com/gorilla/securecookie"
"github.com/gorilla/websocket"
"golang.org/x/net/context"
"gopkg.in/dgrijalva/jwt-go.v3"
"signaling"

View file

@ -22,13 +22,12 @@
package main
import (
"context"
"log"
"sync"
"sync/atomic"
"time"
"golang.org/x/net/context"
"signaling"
)

View file

@ -23,6 +23,7 @@ package signaling
import (
"bytes"
"context"
"crypto/tls"
"encoding/json"
"fmt"
@ -35,7 +36,6 @@ import (
"sync"
"github.com/dlintw/goconf"
"golang.org/x/net/context"
"golang.org/x/net/context/ctxhttp"
)

View file

@ -22,6 +22,7 @@
package signaling
import (
"context"
"encoding/json"
"io/ioutil"
"net/http"
@ -32,7 +33,6 @@ import (
"github.com/dlintw/goconf"
"github.com/gorilla/mux"
"golang.org/x/net/context"
)
func TestPostOnRedirect(t *testing.T) {

View file

@ -23,6 +23,7 @@ package signaling
import (
"bytes"
"context"
"crypto/hmac"
"crypto/sha1"
"encoding/base64"
@ -42,8 +43,6 @@ import (
"github.com/gorilla/mux"
"github.com/gorilla/websocket"
"github.com/nats-io/go-nats"
"golang.org/x/net/context"
)
var (

View file

@ -22,6 +22,7 @@
package signaling
import (
"context"
"encoding/json"
"log"
"net/url"
@ -31,8 +32,6 @@ import (
"unsafe"
"github.com/nats-io/go-nats"
"golang.org/x/net/context"
)
var (

View file

@ -22,6 +22,7 @@
package signaling
import (
"context"
"crypto/hmac"
"crypto/sha256"
"encoding/base64"
@ -41,8 +42,6 @@ import (
"github.com/gorilla/mux"
"github.com/gorilla/securecookie"
"github.com/gorilla/websocket"
"golang.org/x/net/context"
)
var (

View file

@ -22,6 +22,7 @@
package signaling
import (
"context"
"encoding/json"
"io/ioutil"
"net/http"
@ -36,8 +37,6 @@ import (
"github.com/dlintw/goconf"
"github.com/gorilla/mux"
"github.com/gorilla/websocket"
"golang.org/x/net/context"
)
const (

View file

@ -30,6 +30,7 @@ package signaling
import (
"bytes"
"context"
"encoding/json"
"fmt"
"log"
@ -41,8 +42,6 @@ import (
"github.com/gorilla/websocket"
"github.com/notedit/janus-go"
"golang.org/x/net/context"
)
const (

View file

@ -22,11 +22,10 @@
package signaling
import (
"context"
"fmt"
"github.com/dlintw/goconf"
"golang.org/x/net/context"
)
const (

View file

@ -22,6 +22,7 @@
package signaling
import (
"context"
"encoding/json"
"fmt"
"log"
@ -34,8 +35,6 @@ import (
"github.com/dlintw/goconf"
"github.com/nats-io/go-nats"
"github.com/notedit/janus-go"
"golang.org/x/net/context"
)
const (

View file

@ -22,6 +22,7 @@
package signaling
import (
"context"
"crypto/rsa"
"encoding/json"
"fmt"
@ -38,8 +39,6 @@ import (
"github.com/dlintw/goconf"
"github.com/gorilla/websocket"
"golang.org/x/net/context"
"gopkg.in/dgrijalva/jwt-go.v3"
)

View file

@ -22,11 +22,10 @@
package signaling
import (
"context"
"fmt"
"github.com/dlintw/goconf"
"golang.org/x/net/context"
)
type TestMCU struct {

View file

@ -22,6 +22,7 @@
package signaling
import (
"context"
"encoding/json"
"strconv"
"strings"
@ -29,8 +30,6 @@ import (
"time"
"github.com/nats-io/go-nats"
"golang.org/x/net/context"
)
type LoopbackNatsClient struct {

View file

@ -23,14 +23,13 @@ package signaling
import (
"bytes"
"context"
"runtime"
"sync/atomic"
"testing"
"time"
"github.com/nats-io/go-nats"
"golang.org/x/net/context"
)
func (c *LoopbackNatsClient) waitForSubscriptionsEmpty(ctx context.Context, t *testing.T) {

View file

@ -22,10 +22,9 @@
package signaling
import (
"context"
"fmt"
"net/http"
"golang.org/x/net/context"
)
type HttpClientPool struct {

View file

@ -22,11 +22,10 @@
package signaling
import (
"context"
"net/http"
"testing"
"time"
"golang.org/x/net/context"
)
func TestHttpClientPool(t *testing.T) {

View file

@ -23,6 +23,7 @@ package signaling
import (
"bytes"
"context"
"encoding/json"
"log"
"net/url"
@ -30,8 +31,6 @@ import (
"time"
"github.com/nats-io/go-nats"
"golang.org/x/net/context"
)
const (

View file

@ -23,6 +23,7 @@ package signaling
import (
"bytes"
"context"
"encoding/json"
"fmt"
"io/ioutil"
@ -30,8 +31,6 @@ import (
"time"
"github.com/gorilla/websocket"
"golang.org/x/net/context"
)
func TestRoom_InCall(t *testing.T) {

View file

@ -22,6 +22,7 @@
package signaling
import (
"context"
"crypto/hmac"
"crypto/sha256"
"encoding/hex"
@ -34,8 +35,6 @@ import (
"time"
"github.com/gorilla/websocket"
"golang.org/x/net/context"
)
var (