From 6f3acc3ba95299031cf408232e2e65e2c892fd2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=81=E3=82=BB?= <123655015+chise0713@users.noreply.github.com> Date: Sat, 20 Dec 2025 19:38:46 +0800 Subject: [PATCH] Chore: remove unused key-value attribute feature (#3076) Co-authored-by: Loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com> --- main.go | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/main.go b/main.go index 849d29a7..165bb092 100644 --- a/main.go +++ b/main.go @@ -8,7 +8,6 @@ import ( "path/filepath" "regexp" "sort" - "strconv" "strings" router "github.com/v2fly/v2ray-core/v5/app/router/routercommon" @@ -161,20 +160,8 @@ func parseAttribute(attr string) (*router.Domain_Attribute, error) { return &attribute, fmt.Errorf("invalid attribute: %s", attr) } - // Trim attribute prefix `@` character - attr = attr[1:] - parts := strings.Split(attr, "=") - if len(parts) == 1 { - attribute.Key = strings.ToLower(parts[0]) - attribute.TypedValue = &router.Domain_Attribute_BoolValue{BoolValue: true} - } else { - attribute.Key = strings.ToLower(parts[0]) - intv, err := strconv.Atoi(parts[1]) - if err != nil { - return &attribute, fmt.Errorf("invalid attribute: %s: %v", attr, err) - } - attribute.TypedValue = &router.Domain_Attribute_IntValue{IntValue: int64(intv)} - } + attribute.Key = strings.ToLower(attr[1:]) // Trim attribute prefix `@` character + attribute.TypedValue = &router.Domain_Attribute_BoolValue{BoolValue: true} return &attribute, nil }