Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 125 for parseRule (0.18 sec)

  1. src/internal/txtar/archive.go

    	var buf bytes.Buffer
    	buf.Write(fixNL(a.Comment))
    	for _, f := range a.Files {
    		fmt.Fprintf(&buf, "-- %s --\n", f.Name)
    		buf.Write(fixNL(f.Data))
    	}
    	return buf.Bytes()
    }
    
    // ParseFile parses the named file as an archive.
    func ParseFile(file string) (*Archive, error) {
    	data, err := os.ReadFile(file)
    	if err != nil {
    		return nil, err
    	}
    	return Parse(data), nil
    }
    
    // Parse parses the serialized form of an Archive.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 20 02:13:02 UTC 2022
    - 4.2K bytes
    - Viewed (0)
  2. src/go/doc/example_internal_test.go

    import (
    	"a"
    
    	_ "b"
    
    	_ "c"
    	"d"
    )`,
    			want: []string{"a", "b", "c"},
    		},
    	} {
    		t.Run(test.name, func(t *testing.T) {
    			fset := token.NewFileSet()
    			file, err := parser.ParseFile(fset, "test.go", strings.NewReader(test.in), parser.ParseComments)
    			if err != nil {
    				t.Fatal(err)
    			}
    			imps := findImportGroupStarts1(file.Imports)
    			got := make([]string, len(imps))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 10 14:22:16 UTC 2022
    - 1.6K bytes
    - Viewed (0)
  3. src/vendor/golang.org/x/net/route/message.go

    const (
    	SysMetrics SysType = iota
    	SysStats
    )
    
    // ParseRIB parses b as a routing information base and returns a list
    // of routing messages.
    func ParseRIB(typ RIBType, b []byte) ([]Message, error) {
    	if !typ.parseable() {
    		return nil, errUnsupportedMessage
    	}
    	var msgs []Message
    	nmsgs, nskips := 0, 0
    	for len(b) > 4 {
    		nmsgs++
    		l := int(nativeEndian.Uint16(b[:2]))
    		if l == 0 {
    			return nil, errInvalidMessage
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:33 UTC 2023
    - 1.5K bytes
    - Viewed (0)
  4. src/vendor/golang.org/x/net/route/sys_darwin.go

    // Copyright 2016 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package route
    
    import "syscall"
    
    func (typ RIBType) parseable() bool {
    	switch typ {
    	case syscall.NET_RT_STAT, syscall.NET_RT_TRASH:
    		return false
    	default:
    		return true
    	}
    }
    
    // RouteMetrics represents route metrics.
    type RouteMetrics struct {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Aug 05 19:54:32 UTC 2022
    - 2.8K bytes
    - Viewed (0)
  5. pilot/pkg/features/ambient.go

    )
    
    // registerAmbient registers a variable that is allowed only if EnableAmbient is set
    func registerAmbient[T env.Parseable](name string, defaultWithAmbient, defaultWithoutAmbient T, description string) T {
    	if EnableAmbient {
    		return env.Register(name, defaultWithAmbient, description).Get()
    	}
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Sun May 05 00:02:56 UTC 2024
    - 2.4K bytes
    - Viewed (0)
  6. src/go/ast/filter_test.go

    func (t1) f1() {}
    func (t1) f2() {}
    
    func (t2) f1() {}
    
    func (x *t2) f2() {}
    `
    
    func TestFilterDuplicates(t *testing.T) {
    	// parse input
    	fset := token.NewFileSet()
    	file, err := parser.ParseFile(fset, "", input, 0)
    	if err != nil {
    		t.Fatal(err)
    	}
    
    	// create package
    	files := map[string]*ast.File{"": file}
    	pkg, err := ast.NewPackage(fset, files, nil, nil)
    	if err != nil {
    		t.Fatal(err)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 09 15:35:30 UTC 2022
    - 1.6K bytes
    - Viewed (0)
  7. src/go/token/example_test.go

    const bad = token.NoPos
    
    //line fake.go:42:11
    func ok(pos p) bool {
    	return pos != bad
    }
    
    /*line :7:9*/func main() {
    	fmt.Println(ok(bad) == bad.IsValid())
    }
    `
    
    	f, err := parser.ParseFile(fset, "main.go", src, 0)
    	if err != nil {
    		fmt.Println(err)
    		return
    	}
    
    	// Print the location and kind of each declaration in f.
    	for _, decl := range f.Decls {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 09 22:09:31 UTC 2023
    - 1.7K bytes
    - Viewed (0)
  8. src/go/printer/example_test.go

    	"go/ast"
    	"go/parser"
    	"go/printer"
    	"go/token"
    	"strings"
    )
    
    func parseFunc(filename, functionname string) (fun *ast.FuncDecl, fset *token.FileSet) {
    	fset = token.NewFileSet()
    	if file, err := parser.ParseFile(fset, filename, nil, 0); err == nil {
    		for _, d := range file.Decls {
    			if f, ok := d.(*ast.FuncDecl); ok && f.Name.Name == functionname {
    				fun = f
    				return
    			}
    		}
    	}
    	panic("function not found")
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 16 14:55:02 UTC 2022
    - 1.7K bytes
    - Viewed (0)
  9. src/vendor/golang.org/x/net/route/sys_netbsd.go

    // Copyright 2016 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package route
    
    import "syscall"
    
    func (typ RIBType) parseable() bool { return true }
    
    // RouteMetrics represents route metrics.
    type RouteMetrics struct {
    	PathMTU int // path maximum transmission unit
    }
    
    // SysType implements the SysType method of Sys interface.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Aug 05 19:54:32 UTC 2022
    - 2.2K bytes
    - Viewed (0)
  10. src/vendor/golang.org/x/net/route/sys_dragonfly.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package route
    
    import (
    	"syscall"
    	"unsafe"
    )
    
    func (typ RIBType) parseable() bool { return true }
    
    // RouteMetrics represents route metrics.
    type RouteMetrics struct {
    	PathMTU int // path maximum transmission unit
    }
    
    // SysType implements the SysType method of Sys interface.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Aug 05 19:54:32 UTC 2022
    - 2.7K bytes
    - Viewed (0)
Back to top