From 068c0c2c9ef6c2590821524a4b231e682010ca30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=9F=E9=85=8C=20=E9=B5=AC=E5=85=84?= Date: Mon, 14 Mar 2022 07:24:42 +0900 Subject: [PATCH] TrimPrefix not TrimLeft --- freedns/freedns.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/freedns/freedns.go b/freedns/freedns.go index f536bda..093021f 100755 --- a/freedns/freedns.go +++ b/freedns/freedns.go @@ -163,7 +163,7 @@ loop: attrKey, attrValue, moreAttr := htmlTokens.TagAttr() _href := string(attrValue) if string(attrKey) == "href" && strings.Contains(_href, "/subdomain/?limit=") { - dnsObj.DomainId = strings.TrimLeft(_href, "/subdomain/?limit=") + dnsObj.DomainId = strings.TrimPrefix(_href, "/subdomain/?limit=") fmt.Printf("Domain id for \"%s\" is %s\n", DomainName, dnsObj.DomainId) break loop } @@ -325,7 +325,7 @@ loop: if string(attrKey) == "href" && strings.Contains(_href, "edit.php?data_id=") { lookForNextTD = 1 CurrRecordAddr = "" - CurrRecordId = strings.TrimLeft(_href, "edit.php?data_id=") + CurrRecordId = strings.TrimPrefix(_href, "edit.php?data_id=") break } if !moreAttr {