Verified Commit 5ccb2815 authored by Marcel's avatar Marcel

Use 3 digit numbering

parent af5277fb
......@@ -7,13 +7,13 @@ import (
"time"
"flag"
"fmt"
"github.com/chromedp/cdproto/cdp"
cdr "github.com/chromedp/cdproto/runtime"
"github.com/chromedp/chromedp"
"github.com/chromedp/chromedp/runner"
"os"
"runtime"
"strconv"
)
func main() {
......@@ -141,7 +141,8 @@ func screenshot(urlstr, folderPath string) chromedp.Tasks {
}
files, _ := ioutil.ReadDir(folderPath)
count := len(files) + 1
return ioutil.WriteFile(folderPath+"/map"+strconv.Itoa(count)+".png", buf, 0644)
filename := fmt.Sprintf("%s/map%03d.png", folderPath, count)
return ioutil.WriteFile(filename, buf, 0644)
}),
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment