goenvconfig

package module
v0.0.0-...-16c457e Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2022 License: MIT Imports: 2 Imported by: 0

README

goenvconfig

Inspired by Elixir env configs (prod, test, dev) and Ruby .env

Usage

  • include .env , .env.test and .env.development in your project root folder
package main

import (
    "os"

    "github.com/grandeto/goenvconfig"
)

func init() {
    goenvconfig.LoadConfig()
}

func main() {
    dbDsn := os.Getenv("DB_DSN")
}
  • build your go app by including in -tags prod, test or dev depending on your environment
go build -tags prod .

Documentation

Index

Constants

This section is empty.

Variables

Functions

func LoadConfig

func LoadConfig()

Types

This section is empty.

Jump to

Keyboard shortcuts

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