Legacy removed

main
Óscar M. Lage 2024-10-08 21:10:56 +02:00
parent c0b3067f10
commit 288fe952f5
2 changed files with 0 additions and 42 deletions

View File

@ -1,9 +1,7 @@
package utils package utils
import ( import (
"io/ioutil"
"log" "log"
"path/filepath"
"github.com/joho/godotenv" "github.com/joho/godotenv"
) )
@ -14,18 +12,3 @@ func LoadConfig() {
log.Fatal("Error loading .env file") 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
}

View File

@ -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
}