mirror of
https://github.com/tenox7/wrp.git
synced 2024-11-21 19:30:48 +00:00
close template files
This commit is contained in:
parent
e983f244f8
commit
04a755749e
7
wrp.go
7
wrp.go
@ -469,11 +469,13 @@ func tmpl(t string) string {
|
||||
if err != nil {
|
||||
goto builtin
|
||||
}
|
||||
defer fh.Close()
|
||||
|
||||
tmpl, err = ioutil.ReadAll(fh)
|
||||
if err != nil {
|
||||
goto builtin
|
||||
}
|
||||
log.Printf("Got UI template from %v file\n", t)
|
||||
log.Printf("Got HTML UI template from %v file, size %v \n", t, len(tmpl))
|
||||
return string(tmpl)
|
||||
|
||||
builtin:
|
||||
@ -481,12 +483,13 @@ builtin:
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
defer fhs.Close()
|
||||
|
||||
tmpl, err = ioutil.ReadAll(fhs)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
log.Printf("Got UI template from built-in\n")
|
||||
log.Printf("Got HTML UI template from embed\n")
|
||||
return string(tmpl)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user