๐Ÿน @env Operator in TuskLang - Go Guide

Go Documentation

@env Operator in TuskLang - Go Guide

๐ŸŒฑ Environment Variables, Supercharged

TuskLangโ€™s @env operator is the ultimate bridge between your environment and your config. We donโ€™t bow to any kingโ€”not even .env files. Hereโ€™s how to use @env in Go projects for secure, dynamic configuration.

๐Ÿ“‹ Table of Contents

- What is @env? - Basic Usage - Default Values - Security Considerations - Go Integration - Best Practices

๐Ÿงฌ What is @env?

The @env operator injects environment variables directly into your config. No more static secrets or hardcoded valuesโ€”just pure, dynamic power.

๐Ÿ› ๏ธ Basic Usage

[api]
api_key: @env("API_KEY")

๐Ÿช™ Default Values

[api]
timeout: @env("API_TIMEOUT", 30)

๐Ÿ”’ Security Considerations

- Use @env.secure for sensitive values - Never commit secrets to version control - Validate all required env vars at startup

๐Ÿ”— Go Integration

apiKey := config.GetString("api_key") // Loads from @env

Manual Fallback

val := os.Getenv("API_KEY")
if val == "" { val = "default" }

๐Ÿฅ‡ Best Practices

- Use @env for all environment-driven config - Always provide a default value - Validate presence of critical env vars

---

TuskLang: No .env files. No leaks. Just pure environment power.