summary refs log tree commit diff stats
path: root/pkg
diff options
context:
space:
mode:
authorAndinus <andinus@inventati.org>2020-03-16 03:20:59 +0530
committerAndinus <andinus@inventati.org>2020-03-16 03:20:59 +0530
commit8d34c93eba19472077c9fbc6686ddbc5925d1aad (patch)
treef19089eb08ac5a31ea1da5aa30e83be34a728d9f /pkg
parentb5887c34637d87d41e07058f64470469304ba9aa (diff)
downloadcetus-8d34c93eba19472077c9fbc6686ddbc5925d1aad.tar.gz
Fix logical error in ErrChk, bump version & remove RandAlNum v0.4.8
Diffstat (limited to 'pkg')
-rw-r--r--pkg/cetus/cetus.go8
-rw-r--r--pkg/cetus/random.go16
2 files changed, 5 insertions, 19 deletions
diff --git a/pkg/cetus/cetus.go b/pkg/cetus/cetus.go
index 7005c9d..dbf72f8 100644
--- a/pkg/cetus/cetus.go
+++ b/pkg/cetus/cetus.go
@@ -5,7 +5,7 @@ import (
 	"log"
 )
 
-var version string = "v0.4.7"
+var version string = "v0.4.8"
 
 // Version prints cetus version
 func Version() {
@@ -19,6 +19,8 @@ func PrintPath(path string) {
 
 // ErrChk logs the context & error
 func ErrChk(ctx string, err error) {
-	log.Println(ctx)
-	log.Fatal(err)
+	if err != nil {
+		log.Println(ctx)
+		log.Fatal(err)
+	}
 }
diff --git a/pkg/cetus/random.go b/pkg/cetus/random.go
deleted file mode 100644
index d77a24b..0000000
--- a/pkg/cetus/random.go
+++ /dev/null
@@ -1,16 +0,0 @@
-package cetus
-
-import (
-	"math/rand"
-)
-
-// RandAlNum returns random alpha-numeric string of specific length
-func RandAlNum(n int) string {
-	rand.Seed(time.Now().UnixNano())
-	const alphanum = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
-	b := make([]byte, n)
-	for i := range b {
-		b[i] = letterBytes[rand.Intn(len(letterBytes))]
-	}
-	return string(b)
-}