Files
EdgeAPI/internal/utils/compare.go
2024-05-17 18:27:26 +08:00

16 lines
379 B
Go

// Copyright 2022 GoEdge CDN goedge.cdn@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)
}