Browse Source

Initial commit

master 1.0
Alex D. 2 months ago
commit
a3b1314e65
Signed by: caskd
GPG Key ID: F92BA85F61F4C173
  1. 3
      go.mod
  2. 37
      main.go

3
go.mod

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

37
main.go

@ -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)
}
}
}
Loading…
Cancel
Save