Skip to content

Latest commit

 

History

History
32 lines (21 loc) · 422 Bytes

readme.md

File metadata and controls

32 lines (21 loc) · 422 Bytes

ENV

env is a simple package to get enviorment variables from env files. you can also provide default value as fallback when env variable is not found in env files

Basic Usage

package main

import (
	"fmt"
	"os"

	"github.com/nitintf/env/v1"
)

var PORT = env.Int("PORT", 3000)

func main() {
	err := env.Parse()

	if err != nil {
		fmt.Print(err.Error())
		os.Exit(0)
	}

	fmt.Println("PORT", *PORT)
}