MCPcopy
hub / github.com/cweill/gotests / mustReadAndFormatGoFile

Function mustReadAndFormatGoFile

gotests_test.go:941–947  ·  view source on GitHub ↗
(t *testing.T, filename string)

Source from the content-addressed store, hash-verified

939}
940
941func mustReadAndFormatGoFile(t *testing.T, filename string) string {
942 fmted, err := imports.Process(filename, nil, nil)
943 if err != nil {
944 t.Fatalf("reading and formatting file: %v", err)
945 }
946 return string(fmted)
947}
948
949func outputResult(t *testing.T, tmpDir, testName string, got []byte) {
950 tmpResult := path.Join(tmpDir, toSnakeCase(testName)+".go")

Callers 1

TestGenerateTestsFunction · 0.85

Calls 1

ProcessMethod · 0.80

Tested by

no test coverage detected