mirror of https://github.com/mitchell/selfpass.git
20 lines
224 B
Go
20 lines
224 B
Go
|
package migration
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"os"
|
||
|
"runtime"
|
||
|
)
|
||
|
|
||
|
func Check(err error) {
|
||
|
if err != nil {
|
||
|
_, _, line, ok := runtime.Caller(1)
|
||
|
if ok {
|
||
|
fmt.Printf("%v: %s\n", line, err)
|
||
|
os.Exit(1)
|
||
|
}
|
||
|
|
||
|
fmt.Println(err)
|
||
|
}
|
||
|
}
|