Skip to content

math: It would be nice if the math.Min and math.Max functions accepted a variadic param #14246

@watzon

Description

@watzon

Something like this would be nice:

func min(nums ...int) int {
  number = nums[0]
  for i := 1; i < len(nums); i++ {
    if (nums[i] < number) {
      number = nums[i]
    }
  }
  return number
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions