init
This commit is contained in:
commit
7cc71fb719
13 changed files with 840 additions and 0 deletions
24
main.go
Normal file
24
main.go
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"impulse/internal/challenge"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
configPath, eventsPath := "config.json", "events"
|
||||
if len(os.Args) == 3 {
|
||||
configPath, eventsPath = os.Args[1], os.Args[2]
|
||||
} else if len(os.Args) != 1 {
|
||||
fmt.Fprintf(os.Stderr, "usage: %s [config.json events]\n", os.Args[0])
|
||||
os.Exit(2)
|
||||
}
|
||||
|
||||
out, err := challenge.Run(configPath, eventsPath)
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
fmt.Print(out)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue