Eliofile Lister
This commit is contained in:
parent
69cf94bf1e
commit
e36a0cd13f
|
|
@ -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()
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
module gittea.marcokittel.de/elio/eliotools/eliofile
|
||||||
|
|
||||||
|
go 1.24.4
|
||||||
Loading…
Reference in New Issue