Skip to content

Commit 9d49944

Browse files
authored
Remove funlen linter (#433)
1 parent d6b6f05 commit 9d49944

33 files changed

+40
-40
lines changed

.golangci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ linters:
5959
- exportloopref # checks for pointers to enclosing loop variables
6060
- forbidigo # Forbids identifiers
6161
- forcetypeassert # finds forced type assertions
62-
- funlen # Tool for detection of long functions
6362
- gci # Gci control golang package import order and make it always deterministic.
6463
- gochecknoglobals # Checks that no globals are present in Go code
6564
- gocognit # Computes and checks the cognitive complexity of functions
@@ -106,6 +105,7 @@ linters:
106105
- whitespace # Tool for detection of leading and trailing whitespace
107106
disable:
108107
- depguard # Go linter that checks if package imports are in a list of acceptable packages
108+
- funlen # Tool for detection of long functions
109109
- gochecknoinits # Checks that no init functions are present in Go code
110110
- gomodguard # Allow and block list linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations.
111111
- interfacebloat # A linter that checks length of interface.
@@ -135,4 +135,4 @@ issues:
135135
# Allow forbidden identifiers in CLI commands
136136
- path: cmd
137137
linters:
138-
- forbidigo
138+
- forbidigo

client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ func (c *Client) SendBindingRequest() (net.Addr, error) {
240240
return c.SendBindingRequestTo(c.stunServerAddr)
241241
}
242242

243-
func (c *Client) sendAllocateRequest(protocol proto.Protocol) ( // nolint:cyclop,funlen
243+
func (c *Client) sendAllocateRequest(protocol proto.Protocol) ( //nolint:cyclop
244244
proto.RelayedAddress,
245245
proto.Lifetime,
246246
stun.Nonce,
@@ -507,7 +507,7 @@ func (c *Client) HandleInbound(data []byte, from net.Addr) (bool, error) {
507507
return false, nil
508508
}
509509

510-
func (c *Client) handleSTUNMessage(data []byte, from net.Addr) error { // nolint:cyclop,funlen
510+
func (c *Client) handleSTUNMessage(data []byte, from net.Addr) error { //nolint:cyclop
511511
raw := make([]byte, len(data))
512512
copy(raw, data)
513513

client_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func createListeningTestClientWithSTUNServ(t *testing.T, loggerFactory logging.L
6565
return c, conn, true
6666
}
6767

68-
func TestClientWithSTUN(t *testing.T) { // nolint:funlen
68+
func TestClientWithSTUN(t *testing.T) {
6969
loggerFactory := logging.NewDefaultLoggerFactory()
7070
log := loggerFactory.NewLogger("test")
7171

@@ -198,7 +198,7 @@ func TestClientNonceExpiration(t *testing.T) {
198198
}
199199

200200
// Create a TCP-based allocation and verify allocation can be created.
201-
func TestTCPClient(t *testing.T) { // nolint:funlen
201+
func TestTCPClient(t *testing.T) {
202202
// Setup server
203203
tcpListener, err := net.Listen("tcp4", "0.0.0.0:13478") //nolint: gosec
204204
require.NoError(t, err)

examples/turn-client/tcp-alloc/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func setupSignalingChannel(addrCh chan string, signaling bool, relayAddr string)
6161
}
6262
}
6363

64-
func main() { // nolint:funlen,cyclop
64+
func main() { //nolint:cyclop
6565
host := flag.String("host", "", "TURN Server name.")
6666
port := flag.Int("port", 3478, "Listening port.")
6767
user := flag.String("user", "", "A pair of username and password (e.g. \"user=pass\")")

examples/turn-client/tcp/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
"github.com/pion/turn/v4"
1717
)
1818

19-
func main() { // nolint:funlen,cyclop
19+
func main() { //nolint:cyclop
2020
host := flag.String("host", "", "TURN Server name.")
2121
port := flag.Int("port", 3478, "Listening port.")
2222
user := flag.String("user", "", "A pair of username and password (e.g. \"user=pass\")")
@@ -92,7 +92,7 @@ func main() { // nolint:funlen,cyclop
9292
}
9393
}
9494

95-
func doPingTest(client *turn.Client, relayConn net.PacketConn) error { // nolint:cyclop,funlen
95+
func doPingTest(client *turn.Client, relayConn net.PacketConn) error { //nolint:cyclop
9696
// Send BindingRequest to learn our external IP
9797
mappedAddr, err := client.SendBindingRequest()
9898
if err != nil {

examples/turn-client/udp/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
"github.com/pion/turn/v4"
1717
)
1818

19-
func main() { // nolint:funlen,cyclop
19+
func main() { //nolint:cyclop
2020
host := flag.String("host", "", "TURN Server name.")
2121
port := flag.Int("port", 3478, "Listening port.")
2222
user := flag.String("user", "", "A pair of username and password (e.g. \"user=pass\")")
@@ -96,7 +96,7 @@ func main() { // nolint:funlen,cyclop
9696
}
9797
}
9898

99-
func doPingTest(client *turn.Client, relayConn net.PacketConn) error { // nolint:cyclop,funlen
99+
func doPingTest(client *turn.Client, relayConn net.PacketConn) error { //nolint:cyclop
100100
// Send BindingRequest to learn our external IP
101101
mappedAddr, err := client.SendBindingRequest()
102102
if err != nil {

examples/turn-server/add-software-attribute/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func (s *attributeAdder) WriteTo(payload []byte, addr net.Addr) (n int, err erro
4343
return s.PacketConn.WriteTo(payload, addr)
4444
}
4545

46-
func main() { // nolint:funlen
46+
func main() {
4747
publicIP := flag.String("public-ip", "", "IP Address that TURN can be contacted by.")
4848
port := flag.Int("port", 3478, "Listening port.")
4949
users := flag.String("users", "", "List of username and password (e.g. \"user=pass,user=pass\")")

examples/turn-server/log/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func (s *stunLogger) ReadFrom(p []byte) (n int, addr net.Addr, err error) {
5151
return
5252
}
5353

54-
func main() { // nolint:funlen
54+
func main() {
5555
publicIP := flag.String("public-ip", "", "IP Address that TURN can be contacted by.")
5656
port := flag.Int("port", 3478, "Listening port.")
5757
users := flag.String("users", "", "List of username and password (e.g. \"user=pass,user=pass\")")

examples/turn-server/perm-filter/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"github.com/pion/turn/v4"
2222
)
2323

24-
func main() { // nolint:funlen
24+
func main() {
2525
publicIP := flag.String("public-ip", "", "IP Address that TURN can be contacted by.")
2626
port := flag.Int("port", 3478, "Listening port.")
2727
users := flag.String("users", "", "List of username and password (e.g. \"user=pass,user=pass\")")

examples/turn-server/port-range/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"github.com/pion/turn/v4"
1919
)
2020

21-
func main() { // nolint:funlen
21+
func main() {
2222
publicIP := flag.String("public-ip", "", "IP Address that TURN can be contacted by.")
2323
port := flag.Int("port", 3478, "Listening port.")
2424
users := flag.String("users", "", "List of username and password (e.g. \"user=pass,user=pass\")")

0 commit comments

Comments
 (0)