const testTmplString … type field … type function … type receiver … type testInfo … var testTmpl … // AddTestForFunc adds a test for the function enclosing the given input range. // It creates a _test.go file if one does not already exist. func AddTestForFunc(ctx context.Context, snapshot *cache.Snapshot, loc protocol.Location) (changes []protocol.DocumentChange, _ error) { … } // testName returns the name of the function to use for the new function that // tests fn. // Returns empty string if the fn is ill typed or nil. func testName(fn *types.Func) (string, error) { … }