envReader

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 28, 2025 License: MIT Imports: 6 Imported by: 0

README

EnvReader

A lightweight .env file reader for Go, designed to load environment variables from a file into your application seamlessly.

Features

  • Reads .env files and loads key-value pairs as environment variables.

Installation

Run the following command in your project folder to install:

go get github.com/udan-jayanith/envReader

Documentation

Overview

.env file reader for go.

`envReader "github.com/udan-jayanith/envReader"`

Index

Constants

This section is empty.

Variables

View Source
var (
	Env map[string]Type = make(map[string]Type, 2)
)

Functions

func GetRealValue

func GetRealValue(field string) any

GetRealValue returns value for given field as any(int, float64 and string). only returns int, float64 and strings by the GetRealValue.

func GetValue

func GetValue(field string) string

GetValue returns the value for given field as a string.

func LoadEnv

func LoadEnv(path, file string) error

LoadEnv parses the env file using given path and file. Ex: LoadEnv("./", "foo.env").

Types

type Type

type Type struct {
	Value     string
	RealValue any
}

Jump to

Keyboard shortcuts

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