mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-20 03:35:55 +00:00
~I will add pre-commit hook later if I find a good one~ Found a nice repo, but it is no longer maintained: https://github.com/dnephin/pre-commit-golang So, I implemented the check as a local hook.
37 lines
652 B
Go
37 lines
652 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"requests_gun/internal/ammo_provider"
|
|
"requests_gun/internal/parse_args"
|
|
"requests_gun/internal/trigger"
|
|
)
|
|
|
|
func main() {
|
|
args, err := parse_args.Parse()
|
|
if err != nil {
|
|
fmt.Fprintln(os.Stderr, "Error: ", err)
|
|
parse_args.PrintUsage()
|
|
os.Exit(1)
|
|
}
|
|
|
|
if args.Help {
|
|
parse_args.PrintUsage()
|
|
os.Exit(0)
|
|
}
|
|
|
|
fmt.Print("Loading ammo... ")
|
|
f, err := os.Open(args.Ammo)
|
|
if err != nil {
|
|
fmt.Println("Error opening file '", args.Ammo, "': ", err)
|
|
os.Exit(1)
|
|
}
|
|
ammoProvider := ammo_provider.New(f)
|
|
f.Close()
|
|
fmt.Println("Done")
|
|
|
|
fmt.Println("Firing requests...")
|
|
trigger.Fire(ammoProvider, args)
|
|
}
|