add main.go

This commit is contained in:
Александр Шашкин 2022-10-13 22:47:08 +03:00
parent da7241c588
commit 122d39bb19
No known key found for this signature in database
GPG Key ID: 9DB727EBBC568FFF

33
main.go Normal file
View File

@ -0,0 +1,33 @@
package main
import (
"encoding/json"
"log"
"os"
)
func main() {
if len(os.Args) != 2 {
log.Fatalf(
"Expected 1 argument, but %d argument(s) got", len(os.Args)-1)
}
task := os.Args[1]
body, err := getRdbData(task)
if err != nil {
log.Fatal(err)
}
var unmData interface{}
err = json.Unmarshal(body, &unmData)
if err != nil {
log.Fatal(err)
}
processedData, err := getConflicts(unmData)
if err != nil {
log.Fatal(err)
}
printConflicts(processedData)
}