Remove code duplication and run goimports

This commit is contained in:
theodorsm 2024-12-19 17:26:13 +01:00
parent c6a0bc299c
commit 2a212640ce
26 changed files with 53 additions and 65 deletions

View file

@ -1,8 +1,9 @@
package covertdtls
import (
"github.com/theodorsm/covert-dtls/pkg/fingerprints"
"strings"
"github.com/theodorsm/covert-dtls/pkg/fingerprints"
)
type CovertDTLSConfig struct {

View file

@ -1,8 +1,9 @@
package event
import (
"github.com/stretchr/testify/assert"
"testing"
"github.com/stretchr/testify/assert"
)
type stubReceiver struct {

View file

@ -5,6 +5,7 @@ import (
"time"
"github.com/pion/webrtc/v4"
"gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/ptutil/safelog"
)

View file

@ -7,6 +7,7 @@ import (
"bytes"
"encoding/json"
"fmt"
"gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/v2/common/bridgefingerprint"
"gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/v2/common/nat"

View file

@ -1,8 +1,10 @@
package namematcher
import "testing"
import (
"testing"
import . "github.com/smartystreets/goconvey/convey"
. "github.com/smartystreets/goconvey/convey"
)
func TestMatchMember(t *testing.T) {
testingVector := []struct {

View file

@ -16,12 +16,13 @@ package nat
import (
"errors"
"fmt"
"gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/v2/common/proxy"
"log"
"net"
"net/url"
"time"
"gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/v2/common/proxy"
"github.com/pion/stun/v3"
)

View file

@ -2,8 +2,9 @@ package utls
import (
"errors"
utls "github.com/refraction-networking/utls"
"strings"
utls "github.com/refraction-networking/utls"
)
// ported from https://github.com/max-b/snowflake/commit/9dded063cb74c6941a16ad90b9dd0e06e618e55e

View file

@ -1,8 +1,9 @@
package utls
import (
"gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/v2/common/version"
"strings"
"gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/v2/common/version"
)
func generateVersionOutput() string {

View file

@ -5,13 +5,14 @@ import (
"crypto/tls"
"errors"
"fmt"
"golang.org/x/net/proxy"
"net"
"net/http"
"net/url"
"sync"
"time"
"golang.org/x/net/proxy"
utls "github.com/refraction-networking/utls"
"golang.org/x/net/http2"
)