util

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoOnErrOrPanic

func DoOnErrOrPanic(err *error, f func())

DoOnErrOrPanic calls f if the value of err is not nil or if the goroutine is panicking. If there is a panic, it is rethrown.

DoOnErrOrPanic should be called as a defer function to properly handle panics:

defer DoOnErrOrPanic(&returnErr, func() {
	db.Close()
})

func Keys added in v1.0.2

func Keys[K comparable, V any](val map[K]V) []K

Keys returns the keys for a map. An analog be added in golang 1.23. TODO(https://github.com/stripe/pg-schema-diff/issues/227) - Remove this

func NoOpCloser added in v0.9.1

func NoOpCloser() io.Closer

NoOpCloser returns a Closer that does nothing.

Types

This section is empty.

Jump to

Keyboard shortcuts

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