Skip to content

Commit ae14da5

Browse files
authored
Merge pull request #781 from alexadhy/update-golangci
Update golangci to use revive
2 parents 56f7c36 + 7a678f2 commit ae14da5

File tree

6 files changed

+6
-26
lines changed

6 files changed

+6
-26
lines changed

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ linters-settings:
151151

152152
linters:
153153
enable:
154-
- golint
154+
- revive
155155
- goimports
156156
- varcheck
157157
- unparam

internal/vpn/client.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,11 +235,7 @@ func (c *Client) AddDirectRoute(ip net.IP) error {
235235
}
236236
defer c.releaseSysPrivileges()
237237

238-
if err := c.setupDirectRoute(ip); err != nil {
239-
return err
240-
}
241-
242-
return nil
238+
return c.setupDirectRoute(ip)
243239
}
244240

245241
// RemoveDirectRoute removes direct route. Packets destined to `ip` will

pkg/router/route_group.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -428,11 +428,7 @@ func (rg *RouteGroup) sendNetworkProbe() error {
428428

429429
packet := routing.MakeNetworkProbePacket(rule.NextRouteID(), timestamp, throughput)
430430

431-
if err := rg.writePacket(context.Background(), tp, packet, rule.KeyRouteID()); err != nil {
432-
return err
433-
}
434-
435-
return nil
431+
return rg.writePacket(context.Background(), tp, packet, rule.KeyRouteID())
436432
}
437433

438434
func (rg *RouteGroup) networkProbeServiceFn(_ time.Duration) {

pkg/setup/setupclient/client.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,7 @@ func (c *Client) Close() error {
6969
return err
7070
}
7171

72-
if err := c.conn.Close(); err != nil {
73-
return err
74-
}
75-
76-
return nil
72+
return c.conn.Close()
7773
}
7874

7975
// DialRouteGroup generates rules for routes from a visor and sends them to visors.

pkg/snet/directtp/client.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,7 @@ func (c *client) acceptConn() error {
230230
return err
231231
}
232232

233-
if err := lis.Introduce(wrappedConn); err != nil {
234-
return err
235-
}
236-
237-
return nil
233+
return lis.Introduce(wrappedConn)
238234
}
239235

240236
// Dial dials a new Conn to specified remote public key and port.

pkg/util/pathutil/util.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,7 @@ func AtomicWriteFile(filename string, data []byte) error {
4545
return err
4646
}
4747

48-
if err := rename.Rename(tempFilePath, filename); err != nil {
49-
return err
50-
}
51-
52-
return nil
48+
return rename.Rename(tempFilePath, filename)
5349
}
5450

5551
// AtomicAppendToFile calls AtomicWriteFile but appends new data to destiny file

0 commit comments

Comments
 (0)