A simple dotenv for golang

Простая читалка файлов .env

Начало работы

  • Загрузите необходимый репозиторий go get -u github.com/oleg-mordvintsev/go-dot-env-simple/v1.0.4.
  • Подключите в проекте
import (
    env "github.com/oleg-mordvintsev/go-dot-env-simple"
)
  • Инициализация автоматически при первом обращении.

Описание методов

  • Одно значение в .env
env.Get("NAME_ENV_CONST")
  • Одно булево значение в .env
env.GetBool("IS_TEST")`
  • Проверка существования значения в .env
env.Exists("NAME_ENV_CONST")
  • Все значения в .env
env.All()

Текущий функционал

  • Пропуск пустых строк
  • Очистка от незначащих символов в начале и в конце в названиях и значениях
  • Если строка в .env не содержит знака =, то будет выведена ошибка
  • Если строка содержит множество знаков =, то любое последующее вхождение символа будет единым целым со значением
  • Ключ/название переменной не может быть пустым
  • Значения в кавычках, одинарных и двойных, очищаются от кавычек в начале и конце значения
Similar Resources

A simple library to build golang command line (cli / cmd)apps

A simple library to build golang command line (cli / cmd)apps

Jan 11, 2022

A simple golang marshaller from commandline to a struct

flagmarshal SYNOPSIS A simple golang marshaller from commandline to a struct ParseFlags(structptr interface{}) error DESCRIPTION Very simple implement

Jan 22, 2022

Simple and complete API for building command line applications in Go

Simple and complete API for building command line applications in Go Module cli provides a simple, fast and complete API for building command line app

Nov 23, 2022

A Simple and Clear CLI library. Dependency free.

A Simple and Clear CLI library. Dependency free.

A Simple and Clear CLI library. Dependency free. Features Nested Subcommands Uses the standard library flag package Auto-generated help Custom banners

Jan 1, 2023

A simple command line notebook for programmers

A simple command line notebook for programmers

Dnote is a simple command line notebook for programmers. It keeps you focused by providing a way of effortlessly capturing and retrieving information

Jan 2, 2023

Flag is a simple but powerful command line option parsing library for Go support infinite level subcommand

Flag Flag is a simple but powerful commandline flag parsing library for Go. Documentation Documentation can be found at Godoc Supported features bool

Sep 26, 2022

A simple, fast, and fun package for building command line apps in Go

cli cli is a simple, fast, and fun package for building command line apps in Go. The goal is to enable developers to write fast and distributable comm

Dec 31, 2022

A simple logging interface that supports cross-platform color and concurrency.

A simple logging interface that supports cross-platform color and concurrency.

WLog Package wlog creates simple to use UI structure. The UI is used to simply print to the screen. There a wrappers that will wrap each other to crea

Sep 26, 2022
Got: Simple golang package and CLI tool to download large files faster 🏃 than cURL and Wget!

Got. Simple and fast concurrent downloader. Installation ❘ CLI Usage ❘ Module Usage ❘ License Comparison Comparison in cloud server: [root@centos-nyc-

Dec 29, 2022
Lynx is a command line application that build simple golang project
Lynx is a command line application that build simple golang project

Lynx Lynx is a Golang application for easily creating simple Go project Install Just run below commands for install lynx in your system go get -u gith

Oct 1, 2021
a simple golang program that shows the time in asci art.
a simple golang program that shows the time in asci art.

Curtime a simple golang program that shows the time in asci art. Installing Other For other distros you can grab a executable file from the releases.

Oct 8, 2021
Simple trie based auto-completion engine implementation in golang.
Simple trie based auto-completion engine implementation in golang.

Simple auto-complete engine implementation in golang. Quick start $ git clone https://github.com/benbarron/trie-auto-completion-engine $ cd trie-auto-

Jul 12, 2022
Golang-based simple file server to serve files of the current working directory

fileserve Golang-based simple file server to serve static files of the current working directory File sharing in LAN or home network Web application t

Jan 9, 2022
A simple posix shell created in golang

Fox-Shell Description Fox-Shell is a simple posix shell builded with golang Features - chdir works perfectly - mkdir works, but need bug fix To-Do Li

Dec 13, 2021
Simple golang webservice to reply the http request including headers
Simple golang webservice to reply the http request including headers

Echo This is a simple Golang webserver which replies the current HTTP request including its headers. I wrote this little app to test Microsoft Azure A

Dec 15, 2021
A Simple Note API For Golang

Simple Note API Start up run go run main.go Endpoints GET localhost:8080/notes -> gets all of the notes in the database POST localhost:808/note -> cre

Dec 15, 2021
Gowget - A simple wget tool built using golang to download files from the internet whether it is zip

gowget wget built using golang About: A simple wget tool built using golang to d

May 21, 2022
Simple tool to convert a Parquet file to a CSV written in Go/ Golang

Parquet2CSV Parquet2CSV is a simple tool to convert a Parquet file to a CSV written in Go/ Golang Usage: parquet2csv <PATH_TO_PARQUET_FILE> This will

Nov 3, 2022