env

package
v0.0.483-pre-2 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package env implements environment related functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func First added in v0.0.251

func First(keys ...string) string

First is shorthand for FirstOrDefault("", keys...).

func FirstOrDefault added in v0.0.251

func FirstOrDefault(def string, keys ...string) string

FirstOrDefault retrieves the value of the first present environment variable named by the keys. In case no variable is present, FirstOrDefault returns def.

func IsCI

func IsCI() bool

IsCI reports whether the environment is a CI one.

Based on https://github.com/watson/ci-info/blob/c4f1553f254c78babef5c200c48569ede313b718/index.js

func IsSet added in v0.0.251

func IsSet(keys ...string) bool

IsSet reports whether any of the environment variables named by the keys is set.

func IsTruthy added in v0.0.251

func IsTruthy(keys ...string) bool

IsTruthy reports whether any of the values of the environment variables named by the keys evaluates to true.

Types

This section is empty.

Jump to

Keyboard shortcuts

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