From 7b5bba9aba268841b248e416af103ef0a5635c7f Mon Sep 17 00:00:00 2001
From: Lazar <12626340+Lazar955@users.noreply.github.com>
Date: Wed, 6 Nov 2024 16:25:53 +0100
Subject: [PATCH] fix go mod read (#17)

---
 lib/version.go | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/lib/version.go b/lib/version.go
index 6452453..76a16b2 100644
--- a/lib/version.go
+++ b/lib/version.go
@@ -9,20 +9,13 @@ import (
 
 // GetBabylonVersion returns babylond version from go.mod
 func GetBabylonVersion() (string, error) {
-	dir, err := os.Getwd()
-	if err != nil {
-		fmt.Println("Error:", err)
-
-	}
-
-	fmt.Println("Current working directory:", dir)
 	goModPaths := []string{filepath.Join("go.mod"), filepath.Join("..", "go.mod")}
 
 	var data []byte
 	for _, goModPath := range goModPaths {
-		data, err = os.ReadFile(goModPath)
-		if err != nil {
-			continue
+		data, _ = os.ReadFile(goModPath)
+		if data != nil {
+			break
 		}
 	}