diff --git a/utils/config.go b/utils/config.go index 0760cf8..2b16dba 100644 --- a/utils/config.go +++ b/utils/config.go @@ -1,9 +1,7 @@ package utils import ( - "io/ioutil" "log" - "path/filepath" "github.com/joho/godotenv" ) @@ -14,18 +12,3 @@ func LoadConfig() { log.Fatal("Error loading .env file") } } - -func ReadFiles(dir string) ([]string, error) { - files, err := ioutil.ReadDir(dir) - if err != nil { - return nil, err - } - - var filePaths []string - for _, file := range files { - if !file.IsDir() && filepath.Ext(file.Name()) == ".md" { - filePaths = append(filePaths, filepath.Join(dir, file.Name())) - } - } - return filePaths, nil -} diff --git a/utils/file_reader.go b/utils/file_reader.go deleted file mode 100644 index d20055f..0000000 --- a/utils/file_reader.go +++ /dev/null @@ -1,25 +0,0 @@ -// utils/file_reader.go -package utils - -import ( - "fmt" - "io/ioutil" - - "gopkg.in/yaml.v3" -) - -// FunciĆ³n para leer el archivo YAML -func ReadYMLFile(filePath string, out interface{}) error { - data, err := ioutil.ReadFile(filePath) - if err != nil { - return fmt.Errorf("error al leer el archivo %s: %v", filePath, err) - } - - // Deserializar el contenido YAML en la estructura Go pasada en "out" - err = yaml.Unmarshal(data, out) - if err != nil { - return fmt.Errorf("error al deserializar el archivo %s: %v", filePath, err) - } - - return nil -}