Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for read_source (0.1 sec)

  1. scripts/mkdocs_hooks.py

                if isinstance(first_child, Page):
                    if first_child.file.src_path.endswith("index.md"):
                        # Read the source so that the title is parsed and available
                        first_child.read_source(config=config)
                        new_title = first_child.title or new_title
                # Creating a new section makes it render it collapsed by default
                # no idea why, so, let's just modify the existing one
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Tue Oct 24 20:26:06 UTC 2023
    - 5.1K bytes
    - Viewed (0)
  2. src/go/parser/interface.go

    	"errors"
    	"go/ast"
    	"go/token"
    	"io"
    	"io/fs"
    	"os"
    	"path/filepath"
    	"strings"
    )
    
    // If src != nil, readSource converts src to a []byte if possible;
    // otherwise it returns an error. If src == nil, readSource returns
    // the result of reading the file specified by filename.
    func readSource(filename string, src any) ([]byte, error) {
    	if src != nil {
    		switch s := src.(type) {
    		case string:
    			return []byte(s), nil
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 12:02:03 UTC 2023
    - 7.5K bytes
    - Viewed (0)
  3. tests/fuzz/analyzer_fuzzer.go

    		return "nofile", err
    	}
    	return tmpfile.Name(), nil
    }
    
    // createRandomConfigFiles creates a slice of ReaderSources
    func createRandomConfigFiles(f *fuzz.ConsumeFuzzer) ([]local.ReaderSource, error) {
    	var files []local.ReaderSource
    
    	numberOfFiles, err := f.GetInt()
    	if err != nil {
    		return files, err
    	}
    	maxFiles := numberOfFiles % 10
    
    	// Gather test files
    	for i := 0; i < maxFiles; i++ {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue May 23 17:08:31 UTC 2023
    - 4.1K bytes
    - Viewed (0)
  4. pkg/config/analysis/local/analyze_test.go

    	g := NewWithT(t)
    
    	sa := NewSourceAnalyzer(blankCombinedAnalyzer, "", "", nil)
    
    	tmpfile := tempFileFromString(t, YamlN1I1V1)
    	defer os.Remove(tmpfile.Name())
    
    	err := sa.AddReaderKubeSource([]ReaderSource{{Reader: tmpfile}})
    	g.Expect(err).To(BeNil())
    	assert.Equal(t, sa.meshCfg, mesh.DefaultMeshConfig()) // Base default meshcfg
    	g.Expect(sa.stores).To(HaveLen(0))
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Jan 09 07:43:43 UTC 2024
    - 9.6K bytes
    - Viewed (0)
  5. src/go/parser/error_test.go

    			t.Errorf("%s: %s\n", fset.Position(pos), msg)
    		}
    	}
    }
    
    func checkErrors(t *testing.T, filename string, input any, mode Mode, expectErrors bool) {
    	t.Helper()
    	src, err := readSource(filename, input)
    	if err != nil {
    		t.Error(err)
    		return
    	}
    
    	fset := token.NewFileSet()
    	_, err = ParseFile(fset, filename, src, mode)
    	found, ok := err.(scanner.ErrorList)
    	if err != nil && !ok {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 27 19:47:49 UTC 2022
    - 5.9K bytes
    - Viewed (0)
Back to top