INNER CODE UNIT · Go

setupDirs

nisrulz/app-privacy-policy-generator · tools/reviews-page-generator/main.go:70

func setupDirs() {
	for _, d := range []string{jsonDir, imgsDir} {
		os.MkdirAll(d, 0755)
	}
}

func fetchComments(client *http.Client, force bool) []ghComment {
	var all []ghComment
	page := 1

	for {
		path := filepath.Join(jsonDir, fmt.Sprintf("comments_page_%d.json", page))

		if !force {
			if fi, err := os.Stat(path); err == nil && time.Since(fi.ModTime()) < oneWeek {
				data, err := os.ReadFile(path)
				if err == nil {
					var pageComments []ghComment

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…