update
This commit is contained in:
@@ -37,7 +37,7 @@ func exists(filename string) bool {
|
||||
|
||||
func main() {
|
||||
defer func() {
|
||||
if e.Panicked() {
|
||||
if e.Panicked {
|
||||
_ = recover()
|
||||
os.Exit(1)
|
||||
}
|
||||
@@ -82,6 +82,9 @@ func main() {
|
||||
func() {
|
||||
var ok bool
|
||||
defer func() {
|
||||
if e.Panicked {
|
||||
fmt.Fprintln(os.Stderr, "----", filename, "----")
|
||||
}
|
||||
if !ok {
|
||||
_ = os.Remove(filename + ".xml")
|
||||
}
|
||||
@@ -91,7 +94,7 @@ func main() {
|
||||
p(fp.WriteString("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<item>\n"))
|
||||
p(fmt.Fprintf(fp, "<unixTime>%d</unixTime>", t.Unix()))
|
||||
p(fp.Write(item.Data))
|
||||
p(fp.WriteString("</)item>\n"))
|
||||
p(fp.WriteString("</item>\n"))
|
||||
p(fp.Close())
|
||||
p(os.Chtimes(filename+".xml", t, t))
|
||||
ok = true
|
||||
|
||||
Reference in New Issue
Block a user