min

package
Version: v0.0.0-...-49e55dd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package min contains the implementation of the min plugin, which generates the deriveMin function.

The deriveMin function returns the minimum of two arguments.

func deriveMin(T, T) T

deriveMin is a generic version of

math.Min(x, y float64) float64

deriveMin is preferable over abusing math.Min, for not float64 types: https://mrekucci.blogspot.nl/2015/07/dont-abuse-mathmax-mathmin.html

It can also return the minimum element in a list.

func deriveMin(list []T, default T) (min T)

A default value is provided for the empty list.

Example: https://github.com/awalterschulze/goderive/tree/master/example/plugin/min

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

New is a constructor for the min code generator. This generator should be reconstructed for each package.

func NewPlugin

func NewPlugin() derive.Plugin

NewPlugin creates a new min plugin. This function returns the plugin name, default prefix and a constructor for the min code generator.

Types

This section is empty.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL