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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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