chore: reformat code

This commit is contained in:
世界
2022-06-09 21:08:46 +08:00
parent 9a55213ddc
commit cd466f05d3
114 changed files with 159 additions and 185 deletions

View File

@@ -1,10 +1,11 @@
package provider
import (
"strings"
"github.com/Dreamacro/clash/component/trie"
C "github.com/Dreamacro/clash/constant"
"github.com/Dreamacro/clash/log"
"strings"
)
type domainStrategy struct {

View File

@@ -3,17 +3,18 @@ package provider
import (
"bytes"
"crypto/md5"
P "github.com/Dreamacro/clash/constant/provider"
"github.com/Dreamacro/clash/log"
"io/ioutil"
"os"
"path/filepath"
"time"
P "github.com/Dreamacro/clash/constant/provider"
"github.com/Dreamacro/clash/log"
)
var (
fileMode os.FileMode = 0666
dirMode os.FileMode = 0755
fileMode os.FileMode = 0o666
dirMode os.FileMode = 0o755
)
type parser = func([]byte) (interface{}, error)

View File

@@ -2,13 +2,14 @@ package provider
import (
"fmt"
"time"
"github.com/Dreamacro/clash/adapter/provider"
"github.com/Dreamacro/clash/common/structure"
C "github.com/Dreamacro/clash/constant"
P "github.com/Dreamacro/clash/constant/provider"
RC "github.com/Dreamacro/clash/rules/common"
"github.com/Dreamacro/clash/rules/ruleparser"
"time"
)
type ruleProviderSchema struct {

View File

@@ -2,16 +2,15 @@ package provider
import (
"encoding/json"
"runtime"
"time"
C "github.com/Dreamacro/clash/constant"
P "github.com/Dreamacro/clash/constant/provider"
"gopkg.in/yaml.v3"
"runtime"
"time"
)
var (
ruleProviders = map[string]P.RuleProvider{}
)
var ruleProviders = map[string]P.RuleProvider{}
type ruleSetProvider struct {
*fetcher

View File

@@ -2,6 +2,7 @@ package provider
import (
"fmt"
C "github.com/Dreamacro/clash/constant"
P "github.com/Dreamacro/clash/constant/provider"
"github.com/Dreamacro/clash/rules/common"
@@ -38,6 +39,7 @@ func (rs *RuleSet) Payload() string {
func (rs *RuleSet) ShouldResolveIP() bool {
return !rs.noResolveIP && rs.getProviders().ShouldResolveIP()
}
func (rs *RuleSet) getProviders() P.RuleProvider {
if rs.ruleProvider == nil {
rp := RuleProviders()[rs.ruleProviderName]