JOJ3/cmd/sample/main.go
张泊明518370910136 b40072a485
All checks were successful
build-image / create-empty-commit (push) Successful in 5s
checks / build (push) Successful in 1m19s
feat: rename module
2024-09-30 22:04:18 -04:00

27 lines
410 B
Go

package main
import (
"encoding/json"
"flag"
"fmt"
"os"
"github.com/joint-online-judge/JOJ3/pkg/sample"
)
func main() {
score := flag.Int("score", 0, "score")
flag.Parse()
res, err := sample.Run(sample.Conf{Score: *score})
if err != nil {
fmt.Fprint(os.Stderr, err)
os.Exit(1)
}
b, err := json.Marshal(res)
if err != nil {
fmt.Fprint(os.Stderr, err)
os.Exit(1)
}
fmt.Printf("%s", b)
}