db, err := sql.Open("postgres", "…")
if err != nil {
log.Fatalln(err)
}
defer db.Close()
tpl, err := template.ParseGlob("")
if err != nil {
log.Fatalln(err)
}
If template.ParseGlob("")
returns an error, is db.Close()
still being called?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…