refactor: rename output field
This commit is contained in:
		
							parent
							
								
									cf53fc7947
								
							
						
					
					
						commit
						2e80543abf
					
				|  | @ -14,7 +14,7 @@ go build -o ./build/joj3 ./cmd/joj3 | ||||||
| + cd ./_example/simple | + cd ./_example/simple | ||||||
| + ./../../build/joj3 | + ./../../build/joj3 | ||||||
| + cat ./joj3_result.json | + cat ./joj3_result.json | ||||||
| [{"Name":"compile","ParserResults":[{"Score":100,"Comment":"compile done, executor status: run time: 265269232 ns, memory: 57790464 bytes"}]},{"Name":"run","ParserResults":[{"Score":100,"Comment":"executor status: run time: 2033735 ns, memory: 13225984 bytes"},{"Score":100,"Comment":"executor status: run time: 3117399 ns, memory: 14548992 bytes"}]}] | [{"Name":"compile","Results":[{"Score":100,"Comment":"compile done, executor status: run time: 265269232 ns, memory: 57790464 bytes"}]},{"Name":"run","Results":[{"Score":100,"Comment":"executor status: run time: 2033735 ns, memory: 13225984 bytes"},{"Score":100,"Comment":"executor status: run time: 3117399 ns, memory: 14548992 bytes"}]}] | ||||||
| + rm -f ./joj3_result.json | + rm -f ./joj3_result.json | ||||||
| + cd - | + cd - | ||||||
| ``` | ``` | ||||||
|  | @ -27,7 +27,7 @@ Each stage contains a executor and parser. | ||||||
| 
 | 
 | ||||||
| Executor takes a `Cmd` and returns a `ExecutorResult`. | Executor takes a `Cmd` and returns a `ExecutorResult`. | ||||||
| 
 | 
 | ||||||
| Parser takes a `ExecutorResult` and its config and returns a `ParserResult`. | Parser takes a `ExecutorResult` and its config and returns a `ParserResult` and `bool` to indicate whether we should skip the rest stages. | ||||||
| 
 | 
 | ||||||
| ### `Cmd` | ### `Cmd` | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -164,6 +164,6 @@ type ParserResult struct { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| type StageResult struct { | type StageResult struct { | ||||||
| 	Name          string | 	Name    string | ||||||
| 	ParserResults []ParserResult | 	Results []ParserResult | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -25,8 +25,8 @@ func Run(stages []Stage) []StageResult { | ||||||
| 		} | 		} | ||||||
| 		slog.Debug("parser run done", "results", parserResults) | 		slog.Debug("parser run done", "results", parserResults) | ||||||
| 		stageResults = append(stageResults, StageResult{ | 		stageResults = append(stageResults, StageResult{ | ||||||
| 			Name:          stage.Name, | 			Name:    stage.Name, | ||||||
| 			ParserResults: parserResults, | 			Results: parserResults, | ||||||
| 		}) | 		}) | ||||||
| 		if end { | 		if end { | ||||||
| 			break | 			break | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user