Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This line // {"error: %s", []interface{}{errorToBePrinted}, "error: can I be printed?"}, gave panic: reflect: reflect.Value.SetString using value obtained using unexported field Seems to have to do with the for loop using []interface{} and what was being done in the body of the for. in gnovm/stdlibs/error, exporting s in errorString fixed the error: type errorString struct { S /* <- this */ string } But moved the test in its own function, this passes: ``` func TestPrintErrors(t *testing.T) { got := Sprintf("error: %s", errors.New("can I be printed?")) expectedOutput := "error: can I be printed?" if got != expectedOutput { t.Errorf("got %q, want %q.", got, expectedOutput) } } ```
- Loading branch information