aboutsummaryrefslogtreecommitdiff
path: root/common.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2018-05-05 20:08:45 +0700
committerShulhan <ms@kilabit.info>2018-05-12 16:45:07 +0700
commit3fb3f96da782c5e72b58cbd706d6c8f99e19b047 (patch)
tree617e85a156888bb3d34054bde798a5a98bea4e70 /common.go
downloadbeku-3fb3f96da782c5e72b58cbd706d6c8f99e19b047.tar.xz
beku - Go package management with "pacman" like syntax
This first commit only provide library to scan the packages in $GOPATH.
Diffstat (limited to 'common.go')
-rw-r--r--common.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/common.go b/common.go
new file mode 100644
index 0000000..06f186e
--- /dev/null
+++ b/common.go
@@ -0,0 +1,27 @@
+// Copyright 2018, Shulhan <ms@kilabit.info>. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package beku
+
+const (
+ testdataDir = "testdata"
+ vendorDir = "vendor"
+)
+
+//
+// IsIgnoredDir will return true if directory `name` start with `_` or `.`, or
+// equal with `vendor` or `testdata`; otherwise it will return false.
+//
+func IsIgnoredDir(name string) bool {
+ prefix := name[0]
+
+ if prefix == '_' || prefix == '.' {
+ return true
+ }
+ if name == testdataDir || name == vendorDir {
+ return true
+ }
+
+ return false
+}