stamp

a basic static site generator
git clone git://git.ter0.net/stamp.git
Log | Files | Refs | README

commit cb88871d5aab472302e2ad8b8af09f4a825393a9
parent d3ded3f889719a1dfea0dcc102b20ddce82b2560
Author: Chris Johns <chris@ter0.net>
Date:   Mon, 10 May 2021 20:56:06 +0100

Add some comments

Diffstat:
Mmain.go | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/main.go b/main.go @@ -20,11 +20,15 @@ func readFileAsBytes(filename string) []byte { return file } +// shouldSkipDir returns true if the given file is both a directory and begins +// with the character ".". func shouldSkipDir(info os.FileInfo) bool { name := info.Name() return info.IsDir() && strings.HasPrefix(name, ".") } +// shouldSkipFile returns true if the given file begins with the character "_", +// the character ".", or is a directory. func shouldSkipFile(info os.FileInfo) bool { name := info.Name() return strings.HasPrefix(name, "_") || strings.HasPrefix(name, ".") || info.IsDir()