utils

package
v0.0.0-...-718a4ca Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2022 License: MIT Imports: 5 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clamp

func Clamp(x int, min int, max int) int

Clamp returns a value x restricted between min and max

func GetLazyRootDirectory

func GetLazyRootDirectory() string

GetLazyRootDirectory finds a lazy project root directory.

It's used for cheatsheet scripts and integration tests. Not to be confused with finding the root directory of _any_ random repo.

func Max

func Max(x, y int) int

Max returns the maximum of two integers

func Min

func Min(x, y int) int

Min returns the minimum of two integers

Types

type OnceWriter

type OnceWriter struct {
	// contains filtered or unexported fields
}

func NewOnceWriter

func NewOnceWriter(writer io.Writer, f func()) *OnceWriter

func (*OnceWriter) Write

func (self *OnceWriter) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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