fix warning

This commit is contained in:
xushiwei
2024-05-06 08:21:47 +08:00
parent 7223ff004a
commit 7f61989869
3 changed files with 10 additions and 2 deletions

View File

@@ -55,7 +55,7 @@ func main() {
if e == nil {
enc := json.NewEncoder(os.Stdout)
enc.SetIndent("", " ")
enc.Encode(doc)
check(enc.Encode(doc))
return
}
err = e
@@ -63,3 +63,9 @@ func main() {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
func check(err error) {
if err != nil {
panic(err)
}
}