Skip to content

Commit e1cb8f0

Browse files
committed
docs: localize 6 cross-references between style guide documents
- Redirect 6 inter-document links from google.github.io/styleguide/go to our own translated pages - Keep license attribution URLs and external GoTip references pointing to the English original per CC-BY-3.0 requirements
1 parent 74723ab commit e1cb8f0

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

content/best-practices.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ import (
606606
)
607607
```
608608

609-
請遵循[套件命名](https://google.github.io/styleguide/go/decisions#package-names)的風格指引。優先使用完整的單字。短名字是好的,但避免歧義。拿不定主意時,使用 proto 套件名稱去掉 `_go` 之後加上 `pb` 後綴:
609+
請遵循[套件命名](/decisions/#package-names)的風格指引。優先使用完整的單字。短名字是好的,但避免歧義。拿不定主意時,使用 proto 套件名稱去掉 `_go` 之後加上 `pb` 後綴:
610610

611611
```go
612612
// Good:
@@ -982,7 +982,7 @@ err2 := fmt.Errorf("couldn't find fortune database: %v: %w", err, ErrInternal)
982982

983983
- 在 Google 內部,我們有監控系統可以提供比寫到 log 檔再寄望有人注意更有效的告警設定。這與標準函式庫的 [package `expvar`] 概念類似但不同。
984984

985-
[good test failure messages]: https://google.github.io/styleguide/go/decisions#useful-test-failures
985+
[good test failure messages]: /decisions/#useful-test-failures
986986
[stopping the program]: #checks-and-panics
987987
[`rate.Sometimes`]: https://pkg.go.dev/golang.org/x/time/rate#Sometimes
988988
[PII]: https://en.wikipedia.org/wiki/Personal_data
@@ -1037,7 +1037,7 @@ log.V(2).Infof("Handling %v", sql.Explain())
10371037

10381038
**注意:** 標準的 [`net/http` server] 違反此建議,它會 recover 來自 request handler 的 panic。資深 Go 工程師之間的共識是:這在歷史上是個錯誤。如果你抽樣其他語言應用伺服器的 server log,常常會看到大量未被處理的堆疊追蹤,這是常態。請避免在你自己的伺服器中重蹈覆轍。
10391039

1040-
[decision against panics]: https://google.github.io/styleguide/go/decisions#dont-panic
1040+
[decision against panics]: /decisions/#dont-panic
10411041
[`net/http` server]: https://pkg.go.dev/net/http#Server
10421042

10431043
<a id="when-to-panic"></a>

content/decisions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ weight = 2
2929

3030
本文件**並非詳盡無遺**,且會隨時間擴充。當[核心風格指南](/guide/)與此處內容衝突時,**以風格指南為準**,本文件應據此更新。
3131

32-
完整的 Go 風格文件清單請參考[總覽](https://google.github.io/styleguide/go#about)
32+
完整的 Go 風格文件清單請參考[總覽](/#about)
3333

3434
下列章節已從風格決策搬移至指南其他位置:
3535

@@ -3099,8 +3099,8 @@ Go 標準函式庫提供 [`testing` 套件][`testing` package]。在 Google 程
30993099
31003100
當然,如果風格指南未涵蓋的事項需要更多討論,作者歡迎在具體 review 中、或內部訊息板上提出來。
31013101
3102-
[composite declaration best practices]: https://google.github.io/styleguide/go/best-practices#vardeclcomposite
3103-
[initialization best practices]: https://google.github.io/styleguide/go/best-practices#vardeclinitialization
3102+
[composite declaration best practices]: /best-practices/#vardeclcomposite
3103+
[initialization best practices]: /best-practices/#vardeclinitialization
31043104
31053105
<!--
31063106

0 commit comments

Comments
 (0)