Refactor: Use any instead of interface{}

This commit is contained in:
mhsanaei
2025-03-12 20:13:51 +01:00
parent 280a22b57d
commit 0bde51b91e
19 changed files with 267 additions and 280 deletions

View File

@@ -92,7 +92,7 @@ func (x *XrayAPI) DelInbound(tag string) error {
return err
}
func (x *XrayAPI) AddUser(Protocol string, inboundTag string, user map[string]interface{}) error {
func (x *XrayAPI) AddUser(Protocol string, inboundTag string, user map[string]any) error {
var account *serial.TypedMessage
switch Protocol {
case "vmess":

View File

@@ -64,7 +64,7 @@ func GetAccessLogPath() (string, error) {
return "", err
}
jsonConfig := map[string]interface{}{}
jsonConfig := map[string]any{}
err = json.Unmarshal([]byte(config), &jsonConfig)
if err != nil {
logger.Warningf("Failed to parse JSON configuration: %s", err)
@@ -72,7 +72,7 @@ func GetAccessLogPath() (string, error) {
}
if jsonConfig["log"] != nil {
jsonLog := jsonConfig["log"].(map[string]interface{})
jsonLog := jsonConfig["log"].(map[string]any)
if jsonLog["access"] != nil {
accessLogPath := jsonLog["access"].(string)
return accessLogPath, nil