This commit is contained in:
Peter Kleiweg
2026-03-17 12:32:46 +01:00
parent 78dc580c8d
commit 9b65fa8efa
13 changed files with 48 additions and 15 deletions

View File

@@ -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")
}

View File

@@ -41,7 +41,7 @@ func exists(filename string) bool {
func main() {
defer func() {
if e.Panicked() {
if e.Panicked {
_ = recover()
os.Exit(1)
}
@@ -80,6 +80,9 @@ func main() {
func() {
var ok bool
defer func() {
if e.Panicked {
fmt.Fprintln(os.Stderr, "----", filename, "----")
}
if !ok {
_ = os.Remove(filename + ".xml")
}

View File

@@ -56,7 +56,7 @@ func fileDate(filename string) string {
func main() {
defer func() {
if e.Panicked() {
if e.Panicked {
_ = recover()
os.Exit(1)
}
@@ -100,6 +100,9 @@ func main() {
func() {
var ok bool
defer func() {
if e.Panicked {
fmt.Fprintln(os.Stderr, "----", filename, "----")
}
if !ok {
_ = os.Remove(filename + ".xml")
}

View File

@@ -53,7 +53,7 @@ func fileDate(filename string) string {
func main() {
defer func() {
if e.Panicked() {
if e.Panicked {
_ = recover()
os.Exit(1)
}
@@ -99,6 +99,9 @@ func main() {
func() {
var ok bool
defer func() {
if e.Panicked {
fmt.Fprintln(os.Stderr, "----", filename, "----")
}
if !ok {
_ = os.Remove(filename + ".xml")
}

View File

@@ -65,7 +65,7 @@ func fileDate(filename string) string {
func main() {
defer func() {
if e.Panicked() {
if e.Panicked {
_ = recover()
os.Exit(1)
}
@@ -104,6 +104,9 @@ func main() {
func() {
var ok bool
defer func() {
if e.Panicked {
fmt.Fprintln(os.Stderr, "----", filename, "----")
}
if !ok {
_ = os.Remove(filename + ".xml")
}

View File

@@ -56,7 +56,7 @@ func fileDate(filename string) string {
func main() {
defer func() {
if e.Panicked() {
if e.Panicked {
_ = recover()
os.Exit(1)
}
@@ -99,6 +99,9 @@ func main() {
func() {
var ok bool
defer func() {
if e.Panicked {
fmt.Fprintln(os.Stderr, "----", filename, "----")
}
if !ok {
_ = os.Remove(filename + ".xml")
}

View File

@@ -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")
}

View File

@@ -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

View File

@@ -55,7 +55,7 @@ func fileDate(filename string) string {
func main() {
defer func() {
if e.Panicked() {
if e.Panicked {
_ = recover()
os.Exit(1)
}
@@ -94,6 +94,9 @@ func main() {
func() {
var ok bool
defer func() {
if e.Panicked {
fmt.Fprintln(os.Stderr, "----", filename, "----")
}
if !ok {
_ = os.Remove(filename + ".xml")
}

View File

@@ -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")
}

View File

@@ -70,7 +70,7 @@ func fileDate(filename string) string {
func main() {
defer func() {
if e.Panicked() {
if e.Panicked {
_ = recover()
os.Exit(1)
}
@@ -116,6 +116,9 @@ func main() {
func() {
var ok bool
defer func() {
if e.Panicked {
fmt.Fprintln(os.Stderr, "----", filename, "----")
}
if !ok {
_ = os.Remove(filename + ".xml")
}

2
go.mod
View File

@@ -4,4 +4,4 @@ go 1.26.1
require github.com/jbowtie/gokogiri v0.0.0-20250107075044-de0f9d4877a5
require codeberg.org/pebbe/errors v0.3.0
require codeberg.org/pebbe/errors v0.4.0

4
go.sum
View File

@@ -1,4 +1,4 @@
codeberg.org/pebbe/errors v0.3.0 h1:031dKFUvGzXxsb+ig7cKNpohHeQ38ghXDZrd7KehdbU=
codeberg.org/pebbe/errors v0.3.0/go.mod h1:O7PPxUJM1bWRHq11CRK3wqVaH/3NnRaSVZvh3UhzDCY=
codeberg.org/pebbe/errors v0.4.0 h1:G05wsXpC/LRPaL02QYDwtz0sWFWQcIWK1s+MC79LBzU=
codeberg.org/pebbe/errors v0.4.0/go.mod h1:O7PPxUJM1bWRHq11CRK3wqVaH/3NnRaSVZvh3UhzDCY=
github.com/jbowtie/gokogiri v0.0.0-20250107075044-de0f9d4877a5 h1:tQbR4RKFBFi0+Ll69dXejKKUbQVNaOAT2fjlDvSAfx4=
github.com/jbowtie/gokogiri v0.0.0-20250107075044-de0f9d4877a5/go.mod h1:kQE2lxPgVKe0JsBZMFFfMm5zBDCuRhaHFKOBzZeCLiw=