Programming - small usefull notes
  • Home
  • Back to “freeideas.cz”
Select Page

Golang – read ENV variable

by admin | Dec 6, 2016 | golang code snippets | 0 comments

Several snippets regarding ENV variables:

func requireEnvVar(s string) string {
	env, ok := os.LookupEnv(s)
	if !ok {
		panic(fmt.Sprintf("%s isn't defined", s))
	}
	return (env)
}

Submit a Comment Cancel reply

You must be logged in to post a comment.

Recent Posts

  • Golang – Bigquery – clone table structure
  • Golang – insert data from PostgreSQL into InfluxDB
  • Update bigquery table structure based on source postgresql table
  • Run external program with context timeout
  • Run PostgreSQL query with context timeout
  • Golang + pgbouncer + postgresql
  • Golang – find “required” columns on Bigquery
  • Golang installation
  • Golang – compare two dates given as strings
  • Golang – simple “df” decomposition
  • Golang – run external command
  • Golang – dump PostgreSQL functions, tables, views – improved version
  • Golang program – select from Bigquery insert into InfluxDB
  • Golang – decompose PostgreSQL connect string using regexp
  • Golang – PostgreSQL – dump source code of functions

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Recent Posts

  • Golang – Bigquery – clone table structure
  • Golang – insert data from PostgreSQL into InfluxDB
  • Update bigquery table structure based on source postgresql table
  • Run external program with context timeout
  • Run PostgreSQL query with context timeout
  • Golang + pgbouncer + postgresql
  • Golang – find “required” columns on Bigquery
  • Golang installation
  • Golang – compare two dates given as strings
  • Golang – simple “df” decomposition
  • Golang – run external command
  • Golang – dump PostgreSQL functions, tables, views – improved version
  • Golang program – select from Bigquery insert into InfluxDB
  • Golang – decompose PostgreSQL connect string using regexp
  • Golang – PostgreSQL – dump source code of functions
  • Golang – Elasticsearch – aggregation – count distinct values
  • Golang – Elasticsearch – delete by query usage
  • Golang – feed data from MySQL into MemSQL
  • Golang – MySQL base backup + replication command
  • Golang – insert into InfluxDB

Categories

  • Golang + Bigquery
  • Golang + cloud
  • Golang + databases
  • Golang + Elasticsearch
  • Golang + Linux
  • Golang + PostgreSQL
  • golang code snippets
  • Golang overview

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
  • Home
  • Back to “freeideas.cz”
  • Facebook
  • Twitter
  • RSS

Designed by Elegant Themes | Powered by WordPress