优化智能DNS相关代码

This commit is contained in:
GoEdgeLab
2022-09-24 14:07:19 +08:00
parent e6e73991cf
commit a0191fc546
6 changed files with 106 additions and 0 deletions

15
internal/utils/compare.go Normal file
View File

@@ -0,0 +1,15 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package utils
import (
"bytes"
"encoding/json"
)
// EqualConfig 使用JSON对比配置
func EqualConfig(config1 any, config2 any) bool {
config1JSON, _ := json.Marshal(config1)
config2JSON, _ := json.Marshal(config2)
return bytes.Equal(config1JSON, config2JSON)
}