From f9856395dac6e9351cb7969147a63f658d131fbb Mon Sep 17 00:00:00 2001 From: Frederik Zipp Date: Wed, 6 Apr 2022 22:51:31 +0200 Subject: [PATCH] Don't skip directories `.` and `..`. Fixes #44 --- CHANGELOG.md | 4 ++++ analyze.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e212574..774a611 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.5.1] - 2022-04-06 +### Fixed +- Don't skip directories `.` and `..` + ## [0.5.0] - 2022-03-22 ### Changed - Ignore `vendor` and `testdata` directories and directories with names diff --git a/analyze.go b/analyze.go index 3a448b6..2d8bcff 100644 --- a/analyze.go +++ b/analyze.go @@ -59,7 +59,7 @@ var skipDirs = map[string]bool{ func isSkipDir(entry fs.DirEntry) bool { return entry.IsDir() && (skipDirs[entry.Name()] || - strings.HasPrefix(entry.Name(), ".") || + (strings.HasPrefix(entry.Name(), ".") && entry.Name() != "." && entry.Name() != "..") || strings.HasPrefix(entry.Name(), "_")) }