Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 29 for valfunc (0.18 sec)

  1. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/nilfunc/nilfunc.go

    	"golang.org/x/tools/internal/typeparams"
    )
    
    //go:embed doc.go
    var doc string
    
    var Analyzer = &analysis.Analyzer{
    	Name:     "nilfunc",
    	Doc:      analysisutil.MustExtractDoc(doc, "nilfunc"),
    	URL:      "https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/nilfunc",
    	Requires: []*analysis.Analyzer{inspect.Analyzer},
    	Run:      run,
    }
    
    func run(pass *analysis.Pass) (interface{}, error) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 2K bytes
    - Viewed (0)
  2. src/cmd/go/testdata/script/cover_test_pkgselect.txt

    }
    
    -- bar/bar.go --
    package bar
    
    import "example/foo"
    
    func BarFunc() int {
    	return foo.FooFunc2()
    }
    
    -- bar/bar_test.go --
    package bar_test
    
    import (
    	"example/bar"
    	"testing"
    )
    
    func TestBar(t *testing.T) {
    	if bar.BarFunc() != 42 {
    		t.Fatalf("bad")
    	}
    }
    
    -- baz/baz.go --
    package baz
    
    func BazFunc() int {
    	return -42
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 28 11:50:58 UTC 2022
    - 1.3K bytes
    - Viewed (0)
  3. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/nilfunc/doc.go

    // license that can be found in the LICENSE file.
    
    // Package nilfunc defines an Analyzer that checks for useless
    // comparisons against nil.
    //
    // # Analyzer nilfunc
    //
    // nilfunc: check for useless comparisons between functions and nil
    //
    // A useless comparison is one like f == nil as opposed to f() == nil.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 09 01:28:01 UTC 2023
    - 437 bytes
    - Viewed (0)
  4. pkg/volume/volume_linux.go

    //   - callback walkFunc is invoked on root directory after visiting children dirs and files
    func walkDeep(root string, walkFunc filepath.WalkFunc) error {
    	info, err := os.Lstat(root)
    	if err != nil {
    		return walkFunc(root, nil, err)
    	}
    	return walk(root, info, walkFunc)
    }
    
    func walk(path string, info os.FileInfo, walkFunc filepath.WalkFunc) error {
    	if !info.IsDir() {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Apr 03 19:34:37 UTC 2023
    - 6.5K bytes
    - Viewed (0)
  5. src/slices/sort_test.go

    			}
    
    			gotMax := Max(tt.data)
    			if gotMax != tt.wantMax {
    				t.Errorf("Max got %v, want %v", gotMax, tt.wantMax)
    			}
    
    			gotMaxFunc := MaxFunc(tt.data, intCmp)
    			if gotMaxFunc != tt.wantMax {
    				t.Errorf("MaxFunc got %v, want %v", gotMaxFunc, tt.wantMax)
    			}
    		})
    	}
    
    	svals := []S{
    		{1, "a"},
    		{2, "a"},
    		{1, "b"},
    		{2, "b"},
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 09 19:20:55 UTC 2024
    - 9.5K bytes
    - Viewed (0)
  6. src/cmd/go/testdata/script/cover_coverpkg_with_init.txt

    module M
    
    go 1.21
    -- a/a.go --
    package a
    
    import "M/f"
    
    func init() {
    	println("package 'a' init: launch the missiles!")
    }
    
    func AFunc() int {
    	return f.Id()
    }
    -- a/a_test.go --
    package a
    
    import "testing"
    
    func TestA(t *testing.T) {
    	if AFunc() != 42 {
    		t.Fatalf("bad!")
    	}
    }
    -- b/b.go --
    package b
    
    func init() {
    	println("package 'b' init: release the kraken")
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Sep 30 12:33:44 UTC 2023
    - 2.4K bytes
    - Viewed (0)
  7. testing/internal-performance-testing/src/test/groovy/org/gradle/performance/measure/AmountTest.groovy

            def sum = Amount.valueOf(valueA, unitsA) + Amount.valueOf(valueB, unitsB)
            expect:
            sum == Amount.valueOf(valueC, unitsC)
            sum.toString() == Amount.valueOf(valueC, unitsC).toString()
    
            where:
            valueA | unitsA        | valueB | unitsB        | valueC  | unitsC
            0      | Fruit.apples  | 0      | Fruit.oranges | 0       | Fruit.apples
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Apr 04 07:21:38 UTC 2024
    - 9.4K bytes
    - Viewed (0)
  8. src/cmd/cover/testdata/pkgcfg/a/a.go

    type Atyp int
    
    func (ap *Atyp) Set(q int) {
    	*ap = Atyp(q)
    }
    
    func (ap Atyp) Get() int {
    	inter := func(q Atyp) int {
    		return int(q)
    	}
    	return inter(ap)
    }
    
    var afunc = func(x int) int {
    	return x + 1
    }
    var Avar = afunc(42)
    
    func A(x int) int {
    	if x == 0 {
    		return 22
    	} else if x == 1 {
    		return 33
    	}
    	return 44
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 28 11:48:40 UTC 2022
    - 330 bytes
    - Viewed (0)
  9. staging/src/k8s.io/apiserver/plugin/pkg/audit/webhook/webhook.go

    func retryOnError(err error) bool {
    	if err != nil {
    		return true
    	}
    	return false
    }
    
    func loadWebhook(configFile string, groupVersion schema.GroupVersion, retryBackoff wait.Backoff, customDial utilnet.DialFunc) (*webhook.GenericWebhook, error) {
    	clientConfig, err := webhook.LoadKubeconfig(configFile, customDial)
    	if err != nil {
    		return nil, err
    	}
    	w, err := webhook.NewGenericWebhook(audit.Scheme, audit.Codecs, clientConfig,
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Nov 07 21:13:31 UTC 2022
    - 4.5K bytes
    - Viewed (0)
  10. src/slices/sort.go

    		m = max(m, x[i])
    	}
    	return m
    }
    
    // MaxFunc returns the maximal value in x, using cmp to compare elements.
    // It panics if x is empty. If there is more than one maximal element
    // according to the cmp function, MaxFunc returns the first one.
    func MaxFunc[S ~[]E, E any](x S, cmp func(a, b E) int) E {
    	if len(x) < 1 {
    		panic("slices.MaxFunc: empty list")
    	}
    	m := x[0]
    	for i := 1; i < len(x); i++ {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Feb 07 23:54:41 UTC 2024
    - 5.8K bytes
    - Viewed (0)
Back to top