Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for Example_sortMultiKeys (0.14 sec)

  1. src/sort/example_multi_test.go

    }
    
    // ExampleMultiKeys demonstrates a technique for sorting a struct type using different
    // sets of multiple fields in the comparison. We chain together "Less" functions, each of
    // which compares a single field.
    func Example_sortMultiKeys() {
    	// Closures that order the Change structure.
    	user := func(c1, c2 *Change) bool {
    		return c1.user < c2.user
    	}
    	language := func(c1, c2 *Change) bool {
    		return c1.language < c2.language
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 13 20:16:24 UTC 2022
    - 4K bytes
    - Viewed (0)
Back to top