<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Environment Variables on Nalar</title>
    <link>https://nalar.dev/tags/environment-variables/</link>
    <description>Recent content in Environment Variables on Nalar</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Tue, 01 Sep 2026 00:00:00 +0700</lastBuildDate>
    <atom:link href="https://nalar.dev/tags/environment-variables/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Reliable Application Configuration from Environment Variables in Go</title>
      <link>https://nalar.dev/configuration-from-environment-go/</link>
      <pubDate>Tue, 01 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/configuration-from-environment-go/</guid>
      <description>&lt;p&gt;Environment variables are a convenient way to configure deployed Go services, but calling &lt;code&gt;os.Getenv&lt;/code&gt; throughout an application makes configuration difficult to validate and test.&lt;/p&gt;&#xA;&lt;p&gt;A stronger pattern is to load configuration once at startup, parse it into typed fields, validate all invariants, and pass the resulting value to the components that need it.&lt;/p&gt;&#xA;&lt;p&gt;The examples below use only the Go standard library and work with modern supported Go releases.&lt;/p&gt;&#xA;&lt;h2 id=&#34;keep-configuration-in-a-typed-struct&#34;&gt;Keep configuration in a typed struct&lt;/h2&gt;&#xA;&lt;p&gt;Suppose a service needs a listen address, request timeout, and optional log level:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
