Latest Socket ResearchMalicious Chrome Extension Performs Hidden Affiliate Hijacking.Details
Socket
Book a DemoInstallSign in
Socket

maragu.dev/env

Package Overview
Dependencies
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

maragu.dev/env

Go Modules
Version
v0.2.0
Version published
Created
Source

env

GoDoc Go

A small utility package to load different types of environment variables.

Made in 🇩🇰 by maragu, maker of online Go courses.

Usage

go get maragu.dev/env
package main

import (
  "fmt"
  "time"

  "maragu.dev/env"
)

func main() {
  env.MustLoad()
  host := env.GetStringOrDefault("HOST", "localhost")
  port := env.GetIntOrDefault("PORT", 8080)
  tls := env.GetBoolOrDefault("TLS_ENABLED", false)
  shutdownTimeout := env.GetDurationOrDefault("SHUTDOWN_TIMEOUT", time.Minute)
  fmt.Println(host, port, tls, shutdownTimeout)
}

FAQs

Package last updated on 10 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts