chore: FileName -> Filename
All checks were successful
submodules sync / sync (push) Successful in 39s
build / build (push) Successful in 1m31s
build / trigger-build-image (push) Successful in 8s

This commit is contained in:
张泊明518370910136 2025-06-21 13:14:48 -04:00
parent e34cba9b17
commit 498fcf2cdf
GPG Key ID: D47306D7062CDA9D
4 changed files with 6 additions and 6 deletions

View File

@ -15,7 +15,7 @@ type Conf struct {
Cases []struct { Cases []struct {
Outputs []struct { Outputs []struct {
Score int Score int
FileName string Filename string
AnswerPath string AnswerPath string
CompareSpace bool CompareSpace bool
AlwaysHide bool AlwaysHide bool

View File

@ -40,7 +40,7 @@ func (*Diff) Run(results []stage.ExecutorResult, confAny any) (
return nil, true, err return nil, true, err
} }
answerStr := string(answer) answerStr := string(answer)
resultStr := result.Files[output.FileName] resultStr := result.Files[output.Filename]
isSame := stringsEqual( isSame := stringsEqual(
answerStr, answerStr,
resultStr, resultStr,
@ -48,7 +48,7 @@ func (*Diff) Run(results []stage.ExecutorResult, confAny any) (
) )
slog.Debug( slog.Debug(
"compare", "compare",
"filename", output.FileName, "filename", output.Filename,
"answerPath", output.AnswerPath, "answerPath", output.AnswerPath,
"actualLength", len(resultStr), "actualLength", len(resultStr),
"answerLength", len(answerStr), "answerLength", len(answerStr),
@ -65,7 +65,7 @@ func (*Diff) Run(results []stage.ExecutorResult, confAny any) (
} }
comment += conf.FailComment + "\n" comment += conf.FailComment + "\n"
comment += fmt.Sprintf("Difference found in `%s`\n", comment += fmt.Sprintf("Difference found in `%s`\n",
output.FileName) output.Filename)
if !output.AlwaysHide { if !output.AlwaysHide {
if output.MaxDiffLength == 0 { // real default value if output.MaxDiffLength == 0 { // real default value
output.MaxDiffLength = 2048 output.MaxDiffLength = 2048

View File

@ -7,7 +7,7 @@ import "github.com/joint-online-judge/JOJ3/internal/stage"
var name = "log" var name = "log"
type Conf struct { type Conf struct {
FileName string `default:"stdout"` Filename string `default:"stdout"`
Msg string `default:"log msg"` Msg string `default:"log msg"`
Level int `default:"0"` Level int `default:"0"`
} }

View File

@ -10,7 +10,7 @@ import (
) )
func (*Log) parse(executorResult stage.ExecutorResult, conf Conf) stage.ParserResult { func (*Log) parse(executorResult stage.ExecutorResult, conf Conf) stage.ParserResult {
content := executorResult.Files[conf.FileName] content := executorResult.Files[conf.Filename]
var data map[string]any var data map[string]any
err := json.Unmarshal([]byte(content), &data) err := json.Unmarshal([]byte(content), &data)
if err != nil { if err != nil {