Initial commit

This commit is contained in:
Alex D. 2022-04-21 14:56:39 +00:00
commit a7444c575c
Signed by: caskd
GPG Key ID: F92BA85F61F4C173
2 changed files with 34 additions and 0 deletions

3
go.mod Normal file
View File

@ -0,0 +1,3 @@
module git.redxen.eu/caskd/gomon
go 1.18

31
main.go Normal file
View File

@ -0,0 +1,31 @@
package main
import (
"flag"
"fmt"
"log"
"os"
)
func main() {
flag.Parse()
files := make(map[string]int)
for _, v := range flag.Args() {
f, err := os.ReadDir(v)
if err != nil {
log.Fatal(err)
}
for _, v := range f {
files[v.Name()]++
}
}
for k, v := range files {
if v == flag.NArg() {
fmt.Println(k)
}
}
}