env

package module
v0.0.0-...-8bb8b9b Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2025 License: CC0-1.0 Imports: 6 Imported by: 0

README

[!WARNING]
env is in heavy development. its design, behavior, and public interfaces are subject to change at any time without notice. do not rely on it for production use.

env

typesafe env utilities for go.

usage

package main

import (
    "fmt"
    "codeberg.org/ungo/env"
)

type Config struct {
	Environment string `env:"ENVIRONMENT,default=dev"`
}

var cfg Config

func init() {
	err := env.Load(&cfg)
	if err != nil {
		panic(err)
	}
}

func main() {
    fmt.Println("current environment:", cfg.Environment)
}

maintainers

  • @elisiei

license

this software is published under CC0 1.0 Universal (public domain) along with an ip waiver. see license file.

aka: do whatever you want.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(ptr any) error

Types

type Errors

type Errors []error

func (Errors) Error

func (e Errors) Error() string

Directories

Path Synopsis
examples
basic command

Jump to

Keyboard shortcuts

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