MCPcopy Index your code
hub / github.com/tinygo-org/tinygo / readErrorMessages

Function readErrorMessages

errors_test.go:131–144  ·  view source on GitHub ↗

Read "// ERROR:" prefixed messages from the given file.

(t *testing.T, file string)

Source from the content-addressed store, hash-verified

129
130// Read "// ERROR:" prefixed messages from the given file.
131func readErrorMessages(t *testing.T, file string) string {
132 data, err := os.ReadFile(file)
133 if err != nil {
134 t.Fatal("could not read input file:", err)
135 }
136
137 var errors []string
138 for _, line := range strings.Split(string(data), "\n") {
139 if strings.HasPrefix(line, "// ERROR: ") {
140 errors = append(errors, strings.TrimRight(line[len("// ERROR: "):], "\r\n"))
141 }
142 }
143 return strings.Join(errors, "\n")
144}

Callers 1

testErrorMessagesFunction · 0.85

Calls 1

FatalMethod · 0.65

Tested by

no test coverage detected