Sfoglia il codice sorgente

Fail if no png files have been produced

This indicates that something has gone wrong.  There should be at least
one.
Lucas Stadler 8 anni fa
parent
commit
ce382d162c
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  1. 4 0
      go/archive/archive.go

+ 4 - 0
go/archive/archive.go

@ -83,6 +83,10 @@ func main() {
83 83
		exit("filepath.Glob", err)
84 84
	}
85 85
86
	if len(parts) == 0 {
87
		exit("filepath.Glob", fmt.Errorf("no matches"))
88
	}
89
86 90
	h := fmt.Sprintf(".archive/%x.html", buf)
87 91
	f, err = os.OpenFile(h, os.O_CREATE|os.O_EXCL|os.O_WRONLY, 0660)
88 92
	if err != nil {