# I am the Watcher. I am your guide through this vast new twtiverse.
# 
# Usage:
#     https://watcher.sour.is/api/plain/users              View list of users and latest twt date.
#     https://watcher.sour.is/api/plain/twt                View all twts.
#     https://watcher.sour.is/api/plain/mentions?uri=:uri  View all mentions for uri.
#     https://watcher.sour.is/api/plain/conv/:hash         View all twts for a conversation subject.
# 
# Options:
#     uri     Filter to show a specific users twts.
#     offset  Start index for quey.
#     limit   Count of items to return (going back in time).
# 
# twt range = 1 1
# self = https://watcher.sour.is/conv/mk6kfga
sync-Map Code Review
概述--sync.Map 提供了併發安全的 map 操作,數據結構語義類似 map[any]any,多個 goroutine 併發操作時無需加鎖。官方的建議是大多數情況下,應該使用普通 map 類型,並完成對應的鎖和併發控制以保證安全性,這樣可以使類型擁有更好的安全性和可維護性。sync.Map 類型是針對兩種特殊的場景進行優化的:當指定的 key 只被寫入一次,但是被讀取多次,例如不斷增長的緩存 ⌘ Read more