File: util.go

package info (click to toggle)
golang-github-nicholas-fedor-shoutrrr 0.8.15-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,200 kB
  • sloc: sh: 49; makefile: 5
file content (27 lines) | stat: -rw-r--r-- 372 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package util

import (
	"io"
	"log"
)

// Min returns the smallest of a and b.
func Min(a int, b int) int {
	if a < b {
		return a
	}

	return b
}

// Max returns the largest of a and b.
func Max(a int, b int) int {
	if a > b {
		return a
	}

	return b
}

// DiscardLogger is a logger that discards any output written to it.
var DiscardLogger = log.New(io.Discard, "", 0)