Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for ExampleMaxFunc (0.1 sec)

  1. src/slices/example_test.go

    	// Output:
    	// true
    	// false
    }
    
    func ExampleMax() {
    	numbers := []int{0, 42, -10, 8}
    	fmt.Println(slices.Max(numbers))
    	// Output:
    	// 42
    }
    
    func ExampleMaxFunc() {
    	type Person struct {
    		Name string
    		Age  int
    	}
    	people := []Person{
    		{"Gopher", 13},
    		{"Alice", 55},
    		{"Vera", 24},
    		{"Bob", 55},
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 10 17:28:50 UTC 2024
    - 8.1K bytes
    - Viewed (0)
Back to top