20 lines
264 B
Go
20 lines
264 B
Go
|
package simulator
|
||
|
|
||
|
import "log"
|
||
|
|
||
|
// must 处理err, 失败后panic
|
||
|
func must(err error) {
|
||
|
if err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// notMust 处理err, 失败后返回
|
||
|
func notMust(err error) bool {
|
||
|
if err != nil {
|
||
|
log.Fatalln(err)
|
||
|
return false
|
||
|
}
|
||
|
return true
|
||
|
}
|