Skip to content
This repository was archived by the owner on Mar 18, 2021. It is now read-only.
This repository was archived by the owner on Mar 18, 2021. It is now read-only.

Max/Min for Slice of Structs #5

@azimjohn

Description

@azimjohn

Hello Dave,

Thanks for the great package!
I was looking for an elegant way of getting max/min of a slice of structs.

// Example
type benchmark struct {
	time       int
	size       int
}

// Given
var benchmarks []benchmark

/* 
  I sometimes need to find one of the following benchmarks
    - fastest (min time)
    - slowest (max time)
    - smallest (min size)
    - largest (max size)
*/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions