Eliofile Lister

This commit is contained in:
Marco Kittel 2025-06-25 23:07:35 +02:00
parent 69cf94bf1e
commit e36a0cd13f
2 changed files with 43 additions and 0 deletions

40
eliofile/eliofile.go Normal file
View File

@ -0,0 +1,40 @@
package eliofile
import (
"fmt"
"log"
"os"
"strings"
)
type ElioDateiFoo struct {
process func(file string)
}
func NewElioDateiFoo() *ElioDateiFoo {
df := ElioDateiFoo{
process: func(file string) {
fmt.Println(file)
},
}
return &df
}
func (f *ElioDateiFoo) scanCsv() {
files, err := os.ReadDir(".")
if err != nil {
log.Fatal(err)
}
for _, file := range files {
if strings.Contains(file.Name(), "csv") {
f.process(file.Name())
}
}
}
func main() {
df := NewElioDateiFoo()
df.scanCsv()
}

3
eliofile/go.mod Normal file
View File

@ -0,0 +1,3 @@
module gittea.marcokittel.de/elio/eliotools/eliofile
go 1.24.4