- Sort Score
- Result 10 results
- Languages All
Results 1 - 5 of 5 for ReadImports (0.59 sec)
-
src/cmd/go/internal/imports/read_test.go
}, } func TestReadFailures(t *testing.T) { // Errors should be reported (true arg to readImports). testRead(t, readFailuresTests, func(r io.Reader) ([]byte, error) { return ReadImports(r, true, nil) }) } func TestReadFailuresIgnored(t *testing.T) { // Syntax errors should not be reported (false arg to readImports). // Instead, entire file should be the output and no error. // Convert tests not to return syntax errors.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Jun 15 18:42:11 UTC 2021 - 4.2K bytes - Viewed (0) -
src/cmd/go/internal/imports/read.go
// Didn't reach EOF, so must have found a non-space byte. Remove it. r.buf = r.buf[:len(r.buf)-1] } return r.buf, r.err } // ReadImports is like io.ReadAll, except that it expects a Go file as input // and stops reading the input once the imports have completed. func ReadImports(f io.Reader, reportSyntaxError bool, imports *[]string) ([]byte, error) { r := newImportReader(bufio.NewReader(f)) r.readKeyword("package")
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Jun 15 18:42:11 UTC 2021 - 6.1K bytes - Viewed (0) -
src/cmd/dist/imports.go
if r.err == nil && !r.eof { // Didn't reach EOF, so must have found a non-space byte. Remove it. r.buf = r.buf[:len(r.buf)-1] } return r.buf, r.err } // readimports returns the imports found in the named file. func readimports(file string) []string { var imports []string r := &importReader{b: bufio.NewReader(strings.NewReader(readfile(file)))} r.readKeyword("package") r.readIdent()
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Oct 28 21:45:30 UTC 2019 - 6.3K bytes - Viewed (0) -
src/cmd/go/internal/imports/scan.go
testImports := make(map[string]bool) numFiles := 0 Files: for _, name := range files { r, err := fsys.Open(name) if err != nil { return nil, nil, err } var list []string data, err := ReadImports(r, false, &list) r.Close() if err != nil { return nil, nil, fmt.Errorf("reading %s: %v", name, err) } // import "C" is implicit requirement of cgo tag.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Oct 23 19:36:38 UTC 2020 - 2.6K bytes - Viewed (0) -
src/go/build/read_test.go
"syntax error", }, { `package p; import ("x"`, "syntax error", }, } func TestReadFailuresIgnored(t *testing.T) { // Syntax errors should not be reported (false arg to readImports). // Instead, entire file should be the output and no error. // Convert tests not to return syntax errors. tests := make([]readTest, len(readFailuresTests)) copy(tests, readFailuresTests) for i := range tests {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Oct 06 15:53:04 UTC 2021 - 6K bytes - Viewed (0)