Closed junedev closed 2 years ago
Running the tests on the website against the current lasagna stub:
package lasagna
// TODO: define the 'OvenTime' constant
// TODO: define the 'RemainingOvenTime()' function
// TODO: define the 'PreparationTime()' function
// TODO: define the 'ElapsedTime()' function
Typo on the package name
package lasagnaaaa
// OvenTime represents the expected baking time in minutes.
const OvenTime = 40
// RemainingOvenTime returns the remaining minutes based on the `actual` minutes already in the oven.
func RemainingOvenTime(actual int) int {
return OvenTime - actual
}
// PreparationTime calculates the time needed to prepare the lasagna based on the amount of layers.
func PreparationTime(numberOfLayers int) int {
return numberOfLayers * 2
}
// ElapsedTime calculates the total time needed to create and bake a lasagna.
func ElapsedTime(numberOfLayers, actualMinutesInOven int) int {
return PreparationTime(numberOfLayers) + actualMinutesInOven
}
Missing variable (here I deleted the OvenTime constant):
package lasagna
// RemainingOvenTime returns the remaining minutes based on the `actual` minutes already in the oven.
func RemainingOvenTime(actual int) int {
return OvenTime - actual
}
// PreparationTime calculates the time needed to prepare the lasagna based on the amount of layers.
func PreparationTime(numberOfLayers int) int {
return numberOfLayers * 2
}
// ElapsedTime calculates the total time needed to create and bake a lasagna.
func ElapsedTime(numberOfLayers, actualMinutesInOven int) int {
return PreparationTime(numberOfLayers) + actualMinutesInOven
}
Missing function (here I deleted RemainingOvenTime):
package lasagna
// OvenTime represents the expected baking time in minutes.
const OvenTime = 40
// PreparationTime calculates the time needed to prepare the lasagna based on the amount of layers.
func PreparationTime(numberOfLayers int) int {
return numberOfLayers * 2
}
// ElapsedTime calculates the total time needed to create and bake a lasagna.
func ElapsedTime(numberOfLayers, actualMinutesInOven int) int {
return PreparationTime(numberOfLayers) + actualMinutesInOven
}
I narrowed it down a bit. I found out that the actual compiler error is written to stderr but we only return what was written to stdout currently.
It turned out there were two issues here:
The PR fixes both issues.
In the editor bug reports a lot of people wrote they saw
'/usr/local/go/bin/go test --json .' returned exit code 2: exit status 2
as error message which wasn't helpful for them. Is there something that could be improved?I also see the generic "an error occurred" for certain solutions.
I will post some examples below.
My feeling is this happens when the (test) code does not compile.