# 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/uexk5sq
Go 變量遮蔽導致的意外錯誤**
今天要介紹的第一個易犯錯誤就是,變量作用域導致的。變量的作用域是指變量可以被引用的範圍。換句話說,是應用程序中變量名綁定有效的部分。在 Go 語言中,在代碼塊中聲明的變量名可以在內部代碼塊中重新聲明。這個原理被稱爲變量遮蔽,容易犯常見錯誤。下面的示例顯示了由於變量遮蔽而產生的意外副作用。它以兩種不同的方式創建 HTTP 客戶端,這取決於 tracing 的值:var client http.Cli ⌘ Read more