Initial commit

This commit is contained in:
Alex D. 2022-05-08 19:05:01 +00:00
commit a3b1314e65
Signed by: caskd
GPG Key ID: F92BA85F61F4C173
2 changed files with 40 additions and 0 deletions

3
go.mod Normal file
View File

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

37
main.go Normal file
View File

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