JOJ3/internal/parser/dummy/parser.go
张泊明518370910136 5bbbcb14aa
Some checks failed
build / build (push) Successful in 2m3s
build / trigger-build-image (push) Successful in 8s
submodules sync / sync (push) Failing after 30s
refactor(internal): rename executor & parser dir
2024-10-09 05:38:30 -04:00

27 lines
509 B
Go

package dummy
import (
"github.com/joint-online-judge/JOJ3/internal/stage"
)
type Conf struct {
Score int
Comment string
}
type Dummy struct{}
func (*Dummy) Run(results []stage.ExecutorResult, confAny any) (
[]stage.ParserResult, bool, error,
) {
conf, err := stage.DecodeConf[Conf](confAny)
if err != nil {
return nil, true, err
}
var res []stage.ParserResult
for range results {
res = append(res, stage.ParserResult{Score: conf.Score, Comment: conf.Comment})
}
return res, false, nil
}