mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-19 04:10:28 +08:00
优化智能DNS相关代码
This commit is contained in:
15
internal/utils/compare.go
Normal file
15
internal/utils/compare.go
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user