finish translation for don't panic
This commit is contained in:
		
							parent
							
								
									e349089d57
								
							
						
					
					
						commit
						da9b9dc1c3
					
				
							
								
								
									
										16
									
								
								README.md
								
								
								
								
							
							
						
						
									
										16
									
								
								README.md
								
								
								
								
							| 
						 | 
					@ -74,7 +74,7 @@ row before the </tbody></table> line.
 | 
				
			||||||
    - [에러 형(Error Types)](#%ec%97%90%eb%9f%ac-%ed%98%95error-types)
 | 
					    - [에러 형(Error Types)](#%ec%97%90%eb%9f%ac-%ed%98%95error-types)
 | 
				
			||||||
    - [오류 래핑(Error Wrapping)](#%ec%98%a4%eb%a5%98-%eb%9e%98%ed%95%91error-wrapping)
 | 
					    - [오류 래핑(Error Wrapping)](#%ec%98%a4%eb%a5%98-%eb%9e%98%ed%95%91error-wrapping)
 | 
				
			||||||
    - [타입의 어설션 실패 다루기 (Handle Type Assertion Failures)](#%ed%83%80%ec%9e%85%ec%9d%98-%ec%96%b4%ec%84%a4%ec%85%98-%ec%8b%a4%ed%8c%a8-%eb%8b%a4%eb%a3%a8%ea%b8%b0-handle-type-assertion-failures)
 | 
					    - [타입의 어설션 실패 다루기 (Handle Type Assertion Failures)](#%ed%83%80%ec%9e%85%ec%9d%98-%ec%96%b4%ec%84%a4%ec%85%98-%ec%8b%a4%ed%8c%a8-%eb%8b%a4%eb%a3%a8%ea%b8%b0-handle-type-assertion-failures)
 | 
				
			||||||
    - [Don't Panic](#dont-panic)
 | 
					    - [패닉을 피할 것 (Don't Panic)](#%ed%8c%a8%eb%8b%89%ec%9d%84-%ed%94%bc%ed%95%a0-%ea%b2%83-dont-panic)
 | 
				
			||||||
    - [Use go.uber.org/atomic](#use-gouberorgatomic)
 | 
					    - [Use go.uber.org/atomic](#use-gouberorgatomic)
 | 
				
			||||||
  - [Performance](#performance)
 | 
					  - [Performance](#performance)
 | 
				
			||||||
    - [Prefer strconv over fmt](#prefer-strconv-over-fmt)
 | 
					    - [Prefer strconv over fmt](#prefer-strconv-over-fmt)
 | 
				
			||||||
| 
						 | 
					@ -770,11 +770,9 @@ if !ok {
 | 
				
			||||||
<!-- TODO: There are a few situations where the single assignment form is
 | 
					<!-- TODO: There are a few situations where the single assignment form is
 | 
				
			||||||
fine. -->
 | 
					fine. -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Don't Panic
 | 
					### 패닉을 피할 것 (Don't Panic)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Code running in production must avoid panics. Panics are a major source of
 | 
					프로덕션 환경에서 실행되는 코드는 패닉을 반드시 피해야 한다. 패닉은 [cascading failures]의 주요 원인이다. 만약 에러가 발생할 경우, 함수는 에러를 리턴하고 호출자(caller)가 오류 처리 방법을 결정할 수 있도록 해야 한다. 
 | 
				
			||||||
[cascading failures]. If an error occurs, the function must return an error and
 | 
					 | 
				
			||||||
allow the caller to decide how to handle it.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  [cascading failures]: https://en.wikipedia.org/wiki/Cascading_failure
 | 
					  [cascading failures]: https://en.wikipedia.org/wiki/Cascading_failure
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -825,17 +823,13 @@ func main() {
 | 
				
			||||||
</td></tr>
 | 
					</td></tr>
 | 
				
			||||||
</tbody></table>
 | 
					</tbody></table>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Panic/recover is not an error handling strategy. A program must panic only when
 | 
					Panic/recover는 오류 처리 전략(error handling strategy)이 이니다. nil dereference와 같이 복구 할 수 없는 일이 발생하는 경우에만 프로그램이 패닉 상태여야 한다. 프로그램 초기화는 여기에서 예외다: 프로그램을 시작 할 때, 프로그램을 중단해야 할 정도의 좋지 못한 일(bad things)이 발생할 경우 패닉을 일으킬 수 있다.
 | 
				
			||||||
something irrecoverable happens such as a nil dereference. An exception to this is
 | 
					 | 
				
			||||||
program initialization: bad things at program startup that should abort the
 | 
					 | 
				
			||||||
program may cause panic.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
```go
 | 
					```go
 | 
				
			||||||
var _statusTemplate = template.Must(template.New("name").Parse("_statusHTML"))
 | 
					var _statusTemplate = template.Must(template.New("name").Parse("_statusHTML"))
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Even in tests, prefer `t.Fatal` or `t.FailNow` over panics to ensure that the
 | 
					테스트에서 조차도, 테스트가 실패한 것으로 표기되는 것을 보장하기 위해 `panic`보다는 `t.Fatal` 혹은 `t.FailNow`가 선호된다.  
 | 
				
			||||||
test is marked as failed.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
<table>
 | 
					<table>
 | 
				
			||||||
<thead><tr><th>Bad</th><th>Good</th></tr></thead>
 | 
					<thead><tr><th>Bad</th><th>Good</th></tr></thead>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue