diff --git a/.golangci.yml b/.golangci.yml index 6fddc53..d61e68d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -80,10 +80,8 @@ linters: staticcheck: checks: - all - # "could remove embedded field", to keep it explicit! - - -QF1008 - # "could use tagged switch on enum", Cases conflicts with exhaustive! - - -QF1003 + - -QF1008 # "could remove embedded field", to keep it explicit! + - -QF1003 # "could use tagged switch on enum", Cases conflicts with exhaustive! exhaustive: default-signifies-exhaustive: true forbidigo: @@ -93,10 +91,6 @@ linters: - pattern: ^os.Exit$ - pattern: ^panic$ - pattern: ^print(ln)?$ - - pattern: ^testing.T.(Error|Errorf|Fatal|Fatalf|Fail|FailNow)$ - pkg: ^testing$ - msg: use testify/assert instead - analyze-types: true gomodguard: blocked: modules: @@ -106,12 +100,6 @@ linters: govet: enable: - shadow - revive: - rules: - # Prefer 'any' type alias over 'interface{}' for Go 1.18+ compatibility - - name: use-any - severity: warning - disabled: false misspell: locale: US varnamelen: @@ -132,18 +120,15 @@ linters: - linters: - forbidigo - gocognit - path: (examples|main\.go) - - linters: - - gocognit - path: _test\.go + path: (examples|main\.go|_test\.go) - linters: - forbidigo path: cmd formatters: enable: - - gci - - gofmt - - gofumpt - - goimports + - gci # Gci control golang package import order and make it always deterministic. + - gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification + - gofumpt # Gofumpt checks whether code was gofumpt-ed. + - goimports # Goimports does everything that gofmt does. Additionally it checks unused imports exclusions: generated: lax diff --git a/client.go b/client.go index 87d355f..fcf6262 100644 --- a/client.go +++ b/client.go @@ -27,7 +27,7 @@ var ErrUnsupportedURI = fmt.Errorf("invalid schema or transport") // Dial connects to the address on the named network and then // initializes Client on that connection, returning error if any. func Dial(network, address string) (*Client, error) { - conn, err := net.Dial(network, address) + conn, err := net.Dial(network, address) //nolint: noctx if err != nil { return nil, err } @@ -94,7 +94,7 @@ func DialURI(uri *URI, cfg *DialConfig) (*Client, error) { //nolint:cyclop } case (uri.Scheme == SchemeTypeTURNS || uri.Scheme == SchemeTypeSTUNS) && uri.Proto == ProtoTypeTCP: - tlsCfg := cfg.TLSConfig //nolint:govet + tlsCfg := cfg.TLSConfig //nolint:govet, copylocks tlsCfg.ServerName = uri.Host tcpConn, err := nw.Dial("tcp", addr) diff --git a/e2e/main.go b/e2e/main.go index 1c0aba9..1729fbe 100644 --- a/e2e/main.go +++ b/e2e/main.go @@ -25,7 +25,7 @@ func test(network string) { //nolint:cyclop username = "user" password = "secret" ) - conn, err := net.Dial(addr.Network(), addr.String()) + conn, err := net.Dial(addr.Network(), addr.String()) // nolint: noctx if err != nil { log.Fatalln("failed to dial conn:", err) //nolint } diff --git a/go.mod b/go.mod index 3df5e56..b96a17b 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/pion/stun/v3 -go 1.20 +go 1.21 require ( github.com/pion/dtls/v3 v3.0.7 diff --git a/go.sum b/go.sum index 08584d8..f4cf83e 100644 --- a/go.sum +++ b/go.sum @@ -15,6 +15,7 @@ github.com/wlynxg/anet v0.0.3/go.mod h1:eay5PRQr7fIVAMbTbchTnO9gG65Hg/uYGdc7mguH golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=