feat: refactor jsParser to use ParserMethod constants and remove redundant locking in ParseWithContext

This commit is contained in:
krau
2025-08-23 16:04:32 +08:00
parent e5d1e143e0
commit c023fd869d
3 changed files with 28 additions and 19 deletions

View File

@@ -32,8 +32,6 @@ var (
func ParseWithContext(ctx context.Context, url string) (*parser.Item, error) {
doConfig.Do(func() {
parsersMu.Lock()
defer parsersMu.Unlock()
if len(parsers) == 0 {
return
}