|
|
|
|
|
by pcwalton
3252 days ago
|
|
> 1. One assumes that os.Chdir is used down the road. If it failed unchecked it will probably cause a panic later on when it is assumed it succeeded. You could make the same argument about any errors being ignored. The fact is that syntax/semantics that allows any errors to be silently swallowed is suboptimal. > 2. Apart from the few functions that are only called for side effects, the others must return something. Thus ignoring errors is an explicit action. Ignoring errors is not always an explicit action, as you pointed out yourself. In Java, however, it is always an explicit action. Java is simply more robust at making sure errors are handled than Go is. |
|