Files
gochat/scripts/scan_params.py
T
2026-06-04 15:44:48 +08:00

15 lines
432 B
Python

#!/usr/bin/env python3
import re
with open('/home/yanghao05/Workspace/gochat/internal/router/router.go') as f:
content = f.read()
all_params = re.findall(r':(\w+)', content)
param_counts = {}
for p in all_params:
param_counts[p] = param_counts.get(p, 0) + 1
for p, count in sorted(param_counts.items(), key=lambda x: -x[1]):
print(f" :{p}{count} uses")
print(f"\nTotal unique param names: {len(param_counts)}")