second commit
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
#!/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)}")
|
||||
Reference in New Issue
Block a user