Skip to content

Commit a9b10ac

Browse files
committed
cleanup code
1 parent 08f87e2 commit a9b10ac

File tree

9 files changed

+6
-213
lines changed

9 files changed

+6
-213
lines changed

core/src/main/golang/native/config/provider.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,14 @@ func forEachProviders(rawCfg *config.RawConfig, fun func(index int, total int, k
2525

2626
func destroyProviders(cfg *config.Config) {
2727
for _, p := range cfg.Providers {
28-
_ = p.(io.Closer).Close()
28+
if p, ok := p.(io.Closer); ok {
29+
_ = p.Close()
30+
}
2931
}
3032

3133
for _, p := range cfg.RuleProviders {
32-
_ = p.(io.Closer).Close()
34+
if p, ok := p.(io.Closer); ok {
35+
_ = p.Close()
36+
}
3337
}
3438
}

core/src/main/golang/native/log_open.go renamed to core/src/main/golang/native/log.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//go:build !premium
2-
31
package main
42

53
//#include "bridge.h"

core/src/main/golang/native/log_premium.go

Lines changed: 0 additions & 75 deletions
This file was deleted.

core/src/main/golang/native/tun/metadata_open.go renamed to core/src/main/golang/native/tun/metadata.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//go:build !premium
2-
31
package tun
42

53
import (

core/src/main/golang/native/tun/metadata_premium.go

Lines changed: 0 additions & 29 deletions
This file was deleted.

core/src/main/golang/native/tunnel/loopback_open.go renamed to core/src/main/golang/native/tunnel/loopback.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//go:build !premium
2-
31
package tunnel
42

53
import (

core/src/main/golang/native/tunnel/loopback_premium.go

Lines changed: 0 additions & 7 deletions
This file was deleted.

core/src/main/golang/native/tunnel/providers_open.go renamed to core/src/main/golang/native/tunnel/providers.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//go:build !premium
2-
31
package tunnel
42

53
import (

core/src/main/golang/native/tunnel/providers_premium.go

Lines changed: 0 additions & 92 deletions
This file was deleted.

0 commit comments

Comments
 (0)