[{"data":1,"prerenderedAt":1384},["ShallowReactive",2],{"blog-environment-variable-golang":3,"blog-all-for-related":890},{"id":4,"title":5,"author":6,"body":7,"cardAlt":5,"categories":875,"description":878,"draft":879,"extension":880,"headerImage":881,"keywords":882,"meta":883,"name":884,"navigation":261,"path":885,"seo":886,"series":6,"stem":887,"updated":6,"year":888,"__hash__":889},"blog\u002Fblog\u002Fenvironment-variable-golang.md","Guide to Environment variables in Go",null,{"type":8,"value":9,"toc":866},"minimark",[10,14,17,862],[11,12,13],"p",{},"In this tutorial, I will be covering the basics around environment variables and some of the default and most used Golang environment variables. We will also learn how to set environment config from our golang programs.",[11,15,16],{},"Let's begin!",[18,19,20,25,43,55,58,65,68,72,75,80,87,91,94,120,127,136,147,151,157,164,167,195,202,206,209],"ads",{},[21,22,24],"h2",{"id":23},"what-are-the-environment-variables","What are the environment variables?",[11,26,27,28,38,39],{},"An ",[29,30,34],"a",{"href":31,"rel":32},"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FEnvironment_variable",[33],"nofollow",[35,36,37],"em",{},"environment variable"," is a name\u002Fvalue pair that is present outside of the program but can be referenced at a given time. There are a lot of environment variables which are already predefined in your system. Eg. ",[40,41,42],"strong",{},"$HOME",[11,44,45,46,50,51,54],{},"Trying running ",[47,48,49],"code",{},"echo $HOME"," this will display your current user home directory. For me it's like - ",[47,52,53],{},"\u002Fhome\u002Fmohit"," . The result may vary based on your OS. Since I am using Ubuntu, the results might be different on your machine. But, concepts remains the same 😎",[11,56,57],{},"These environment variables can be set\u002Funset or used anytime similar to how variables work in our programs.",[11,59,60,61,64],{},"You can see all the environment variables in your system with ",[47,62,63],{},"env"," command.",[66,67],"hr",{},[21,69,71],{"id":70},"go-default-environment-variables","Go default Environment variables",[11,73,74],{},"There are many variables that come with Golang when you install it and can be configured as per use. Some of the most used ones are -",[76,77,79],"h3",{"id":78},"goroot","GOROOT",[11,81,82,83,86],{},"This is the path where the Go standard library is located on your local filesystem. You generally won't need to modify this unless you want to use some other versions of Go as well. It is set to ",[47,84,85],{},"\u002Fusr\u002Flocal\u002F\u003Cgo-version>"," by default",[76,88,90],{"id":89},"gopath","GOPATH",[11,92,93],{},"This variable defines the root of your workspace. It tells Go where to look for your code. It stores all the files necessary for the development of the programs. It consists of three directories -",[95,96,97,108,114],"ul",{},[98,99,100,103,104,107],"li",{},[47,101,102],{},"\u002Fbin"," - where go places binaries that ",[47,105,106],{},"go install"," compile",[98,109,110,113],{},[47,111,112],{},"\u002Fpkg"," - location of compiled package code",[98,115,116,119],{},[47,117,118],{},"\u002Fsrc"," - where your go code resides",[11,121,122,123,126],{},"By default, it is unset and points to a subdirectory named ",[47,124,125],{},"go"," in the user's home directory. ($HOME\u002Fgo on Unix, %USERPROFILE%\\go on Windows)",[11,128,129,130,135],{},"Note from ",[29,131,134],{"href":132,"rel":133},"https:\u002F\u002Fgolang.org\u002Fref\u002Fmod",[33],"official Go docs",". In module-aware mode -",[95,137,138,141,144],{},[98,139,140],{},"Module cache is stored in the pkg\u002Fmod subdirectory of the first GOPATH directory.",[98,142,143],{},"Module source code outside the cache may be stored in any directory.",[98,145,146],{},"If GOPATH is not set, it defaults to the go subdirectory of the user's home directory.",[76,148,150],{"id":149},"goproxy","GOPROXY",[152,153,154],"blockquote",{},[11,155,156],{},"A Go module proxy is any web server that can respond to GET requests\nfor URLs of a specified form.",[11,158,159,160,163],{},"GO proxy allows control over the download source and provides caching as well. This serves the ",[47,161,162],{},"zip"," archive of source code over HTTP making it faster.",[11,165,166],{},"You can use the proxy server by setting -",[168,169,174],"pre",{"className":170,"code":171,"language":172,"meta":173,"style":173},"language-bash shiki shiki-themes github-light github-dark","export GOPROXY=https:\u002F\u002Fproxy.golang.org\u002F\n","bash","",[47,175,176],{"__ignoreMap":173},[177,178,181,185,189,192],"span",{"class":179,"line":180},"line",1,[177,182,184],{"class":183},"szBVR","export",[177,186,188],{"class":187},"sVt8B"," GOPROXY",[177,190,191],{"class":183},"=",[177,193,194],{"class":187},"https:\u002F\u002Fproxy.golang.org\u002F\n",[11,196,197,198,201],{},"The above proxy is run by the Go team. To make changes permanent , add it to ",[47,199,200],{},"~\u002F.bashrc",".",[76,203,205],{"id":204},"goos","GOOS",[11,207,208],{},"GOOS defines the operating system for which to compile code. Examples are linux, darwin, windows, etc. This is an optional environment variable by default is set to empty.",[18,210,211,213,217,220,223,241,446,475,485,488,508,517,526,750,763,776,779,802,804,808,831,834,843,845,848,857],{},[66,212],{},[21,214,216],{"id":215},"setting-custom-env-variablesconfigs-in-go","Setting custom Env. variables\u002FConfigs in Go",[11,218,219],{},"Now that you have learned the basics of environment variables and some default ones provided by Go, you might be wondering to use it in your own projects. Configs should be used to store all kind of important information which can be easy to change. This also provides additional security to your passwords, secret keys to be directly available in your source code and are visible to anyone who has access to code.",[11,221,222],{},"Also, various environments require different configs. Like you would want to give different config in your test\u002Fdevelopment servers to those of production servers.",[11,224,225,226,229,230,229,233,236,237,240],{},"That's a lot of explanation but it was required so that you don't push secrets and use configs. There are a lot of ways to manage configs in go projects via ",[47,227,228],{},".env",",",[47,231,232],{},".json",[47,234,235],{},".yaml",", ",[47,238,239],{},".toml"," and other formats. For simplicity, for now we will set the environment variables via code -",[168,242,245],{"className":243,"code":244,"language":125,"meta":173,"style":173},"language-go shiki shiki-themes github-light github-dark","package main\n\nimport (\n    \"fmt\"\n    \"os\"\n)\n\nfunc main() {\n    \u002F\u002F Set an environment variable\n    os.Setenv(\"SOME_VARIABLE\", \"SOME_VALUE\")\n\n    \u002F\u002F Get the environment variable we set in previous step\n    value := os.Getenv(\"SOME_VARIABLE\")\n    fmt.Println(value)\n\n    \u002F\u002F Unset an Environment Variable\n    os.Unsetenv(\"SOME_VARIABLE\")\n    fmt.Println(\"After unset -> \", os.Getenv(\"SOME_VARIABLE\"))\n}\n",[47,246,247,256,263,272,285,295,301,306,318,325,347,352,358,379,391,396,402,416,440],{"__ignoreMap":173},[177,248,249,252],{"class":179,"line":180},[177,250,251],{"class":183},"package",[177,253,255],{"class":254},"sScJk"," main\n",[177,257,259],{"class":179,"line":258},2,[177,260,262],{"emptyLinePlaceholder":261},true,"\n",[177,264,266,269],{"class":179,"line":265},3,[177,267,268],{"class":183},"import",[177,270,271],{"class":187}," (\n",[177,273,275,279,282],{"class":179,"line":274},4,[177,276,278],{"class":277},"sZZnC","    \"",[177,280,281],{"class":254},"fmt",[177,283,284],{"class":277},"\"\n",[177,286,288,290,293],{"class":179,"line":287},5,[177,289,278],{"class":277},[177,291,292],{"class":254},"os",[177,294,284],{"class":277},[177,296,298],{"class":179,"line":297},6,[177,299,300],{"class":187},")\n",[177,302,304],{"class":179,"line":303},7,[177,305,262],{"emptyLinePlaceholder":261},[177,307,309,312,315],{"class":179,"line":308},8,[177,310,311],{"class":183},"func",[177,313,314],{"class":254}," main",[177,316,317],{"class":187},"() {\n",[177,319,321],{"class":179,"line":320},9,[177,322,324],{"class":323},"sJ8bj","    \u002F\u002F Set an environment variable\n",[177,326,328,331,334,337,340,342,345],{"class":179,"line":327},10,[177,329,330],{"class":187},"    os.",[177,332,333],{"class":254},"Setenv",[177,335,336],{"class":187},"(",[177,338,339],{"class":277},"\"SOME_VARIABLE\"",[177,341,236],{"class":187},[177,343,344],{"class":277},"\"SOME_VALUE\"",[177,346,300],{"class":187},[177,348,350],{"class":179,"line":349},11,[177,351,262],{"emptyLinePlaceholder":261},[177,353,355],{"class":179,"line":354},12,[177,356,357],{"class":323},"    \u002F\u002F Get the environment variable we set in previous step\n",[177,359,361,364,367,370,373,375,377],{"class":179,"line":360},13,[177,362,363],{"class":187},"    value ",[177,365,366],{"class":183},":=",[177,368,369],{"class":187}," os.",[177,371,372],{"class":254},"Getenv",[177,374,336],{"class":187},[177,376,339],{"class":277},[177,378,300],{"class":187},[177,380,382,385,388],{"class":179,"line":381},14,[177,383,384],{"class":187},"    fmt.",[177,386,387],{"class":254},"Println",[177,389,390],{"class":187},"(value)\n",[177,392,394],{"class":179,"line":393},15,[177,395,262],{"emptyLinePlaceholder":261},[177,397,399],{"class":179,"line":398},16,[177,400,401],{"class":323},"    \u002F\u002F Unset an Environment Variable\n",[177,403,405,407,410,412,414],{"class":179,"line":404},17,[177,406,330],{"class":187},[177,408,409],{"class":254},"Unsetenv",[177,411,336],{"class":187},[177,413,339],{"class":277},[177,415,300],{"class":187},[177,417,419,421,423,425,428,431,433,435,437],{"class":179,"line":418},18,[177,420,384],{"class":187},[177,422,387],{"class":254},[177,424,336],{"class":187},[177,426,427],{"class":277},"\"After unset -> \"",[177,429,430],{"class":187},", os.",[177,432,372],{"class":254},[177,434,336],{"class":187},[177,436,339],{"class":277},[177,438,439],{"class":187},"))\n",[177,441,443],{"class":179,"line":442},19,[177,444,445],{"class":187},"}\n",[168,447,449],{"className":170,"code":448,"language":172,"meta":173,"style":173},"# Output\nSOME_VALUE\nAfter unset ->\n",[47,450,451,456,461],{"__ignoreMap":173},[177,452,453],{"class":179,"line":180},[177,454,455],{"class":323},"# Output\n",[177,457,458],{"class":179,"line":258},[177,459,460],{"class":254},"SOME_VALUE\n",[177,462,463,466,469,472],{"class":179,"line":265},[177,464,465],{"class":254},"After",[177,467,468],{"class":277}," unset",[177,470,471],{"class":187}," -",[177,473,474],{"class":183},">\n",[11,476,477,478,481,482],{},"Here, the program is pretty straightforward where we first set the variable and then fetch it with ",[47,479,480],{},"os.Getenv()",", then we unset it using ",[47,483,484],{},"os.Unsetenv()",[11,486,487],{},"There are a couple of other useful methods -",[95,489,490,496,502],{},[98,491,492,495],{},[47,493,494],{},"os.Environ()"," - This returns all the environment variable which are set in key=value format.",[98,497,498,501],{},[47,499,500],{},"os.LookupEnv()"," - This function combines the functionality of checking whether such variable exists, if yes then it returns the value.",[98,503,504,507],{},[47,505,506],{},"os.Clearenv()","- This method deletes all the environment variables and is useful when we are writing tests.",[11,509,510,511,516],{},"Well, it is not a good practice to use these secrets in your code directly. To solve this there are a number of libraries like ",[29,512,515],{"href":513,"rel":514},"https:\u002F\u002Fgithub.com\u002Fjoho\u002Fgodotenv",[33],"godotenv",", etc.",[11,518,519,520,522,523],{},"Here, the code below uses ",[47,521,515],{}," -\nYou can get it using ",[47,524,525],{},"go get github.com\u002Fjoho\u002Fgodotenv",[168,527,529],{"className":243,"code":528,"language":125,"meta":173,"style":173},"package main\n\nimport (\n    \"log\"\n    \"github.com\u002Fjoho\u002Fgodotenv\"\n    \"fmt\"\n    \"os\"\n)\n\n\u002F\u002F init() is invoked before main()\n\u002F\u002F Loading variables before main() runs\nfunc init() {\n    \u002F\u002F loads values from .env into the system\n    if err := godotenv.Load(); err != nil {\n        log.Print(\".env file not found\")\n    }\n}\n\nfunc main() {\n    \u002F\u002F Get the REDIS_PORT environment variable\n    redisPort, found := os.LookupEnv(\"REDIS_PORT\")\n    if found {\n        fmt.Println(redisPort)\n    }\n}\n\n\u002F\u002F Output based on .env below\n6379\n",[47,530,531,537,541,547,556,565,573,581,585,589,594,599,608,613,642,657,662,666,670,678,684,704,712,723,728,733,738,744],{"__ignoreMap":173},[177,532,533,535],{"class":179,"line":180},[177,534,251],{"class":183},[177,536,255],{"class":254},[177,538,539],{"class":179,"line":258},[177,540,262],{"emptyLinePlaceholder":261},[177,542,543,545],{"class":179,"line":265},[177,544,268],{"class":183},[177,546,271],{"class":187},[177,548,549,551,554],{"class":179,"line":274},[177,550,278],{"class":277},[177,552,553],{"class":254},"log",[177,555,284],{"class":277},[177,557,558,560,563],{"class":179,"line":287},[177,559,278],{"class":277},[177,561,562],{"class":254},"github.com\u002Fjoho\u002Fgodotenv",[177,564,284],{"class":277},[177,566,567,569,571],{"class":179,"line":297},[177,568,278],{"class":277},[177,570,281],{"class":254},[177,572,284],{"class":277},[177,574,575,577,579],{"class":179,"line":303},[177,576,278],{"class":277},[177,578,292],{"class":254},[177,580,284],{"class":277},[177,582,583],{"class":179,"line":308},[177,584,300],{"class":187},[177,586,587],{"class":179,"line":320},[177,588,262],{"emptyLinePlaceholder":261},[177,590,591],{"class":179,"line":327},[177,592,593],{"class":323},"\u002F\u002F init() is invoked before main()\n",[177,595,596],{"class":179,"line":349},[177,597,598],{"class":323},"\u002F\u002F Loading variables before main() runs\n",[177,600,601,603,606],{"class":179,"line":354},[177,602,311],{"class":183},[177,604,605],{"class":254}," init",[177,607,317],{"class":187},[177,609,610],{"class":179,"line":360},[177,611,612],{"class":323},"    \u002F\u002F loads values from .env into the system\n",[177,614,615,618,621,623,626,629,632,635,639],{"class":179,"line":381},[177,616,617],{"class":183},"    if",[177,619,620],{"class":187}," err ",[177,622,366],{"class":183},[177,624,625],{"class":187}," godotenv.",[177,627,628],{"class":254},"Load",[177,630,631],{"class":187},"(); err ",[177,633,634],{"class":183},"!=",[177,636,638],{"class":637},"sj4cs"," nil",[177,640,641],{"class":187}," {\n",[177,643,644,647,650,652,655],{"class":179,"line":393},[177,645,646],{"class":187},"        log.",[177,648,649],{"class":254},"Print",[177,651,336],{"class":187},[177,653,654],{"class":277},"\".env file not found\"",[177,656,300],{"class":187},[177,658,659],{"class":179,"line":398},[177,660,661],{"class":187},"    }\n",[177,663,664],{"class":179,"line":404},[177,665,445],{"class":187},[177,667,668],{"class":179,"line":418},[177,669,262],{"emptyLinePlaceholder":261},[177,671,672,674,676],{"class":179,"line":442},[177,673,311],{"class":183},[177,675,314],{"class":254},[177,677,317],{"class":187},[177,679,681],{"class":179,"line":680},20,[177,682,683],{"class":323},"    \u002F\u002F Get the REDIS_PORT environment variable\n",[177,685,687,690,692,694,697,699,702],{"class":179,"line":686},21,[177,688,689],{"class":187},"    redisPort, found ",[177,691,366],{"class":183},[177,693,369],{"class":187},[177,695,696],{"class":254},"LookupEnv",[177,698,336],{"class":187},[177,700,701],{"class":277},"\"REDIS_PORT\"",[177,703,300],{"class":187},[177,705,707,709],{"class":179,"line":706},22,[177,708,617],{"class":183},[177,710,711],{"class":187}," found {\n",[177,713,715,718,720],{"class":179,"line":714},23,[177,716,717],{"class":187},"        fmt.",[177,719,387],{"class":254},[177,721,722],{"class":187},"(redisPort)\n",[177,724,726],{"class":179,"line":725},24,[177,727,661],{"class":187},[177,729,731],{"class":179,"line":730},25,[177,732,445],{"class":187},[177,734,736],{"class":179,"line":735},26,[177,737,262],{"emptyLinePlaceholder":261},[177,739,741],{"class":179,"line":740},27,[177,742,743],{"class":323},"\u002F\u002F Output based on .env below\n",[177,745,747],{"class":179,"line":746},28,[177,748,749],{"class":637},"6379\n",[11,751,752,753,755,756,759,760,762],{},"In this code, we first load the environment variables from a ",[47,754,228],{}," file in this project directory. Then, we fetch the ",[47,757,758],{},"REDIS_PORT"," key. The ",[47,761,228],{}," file looks like -",[168,764,766],{"className":170,"code":765,"language":172,"meta":173,"style":173},"REDIS_PORT=6379\n",[47,767,768],{"__ignoreMap":173},[177,769,770,772,774],{"class":179,"line":180},[177,771,758],{"class":187},[177,773,191],{"class":183},[177,775,749],{"class":277},[11,777,778],{},"In case you are looking for pre-shipped packages, There are many useful open-source packages which help in managing environment configs -",[95,780,781,788,795],{},[98,782,783],{},[29,784,787],{"href":785,"rel":786},"https:\u002F\u002Fgithub.com\u002Fspf13\u002Fviper",[33],"Viper",[98,789,790],{},[29,791,794],{"href":792,"rel":793},"https:\u002F\u002Fgithub.com\u002Fkelseyhightower\u002Fenvconfig",[33],"Envconfig",[98,796,797],{},[29,798,801],{"href":799,"rel":800},"https:\u002F\u002Fgithub.com\u002Fmotdotla\u002Fdotenv",[33],"Dotenv",[66,803],{},[21,805,807],{"id":806},"resources","Resources",[95,809,810,817,824],{},[98,811,812],{},[29,813,816],{"href":814,"rel":815},"https:\u002F\u002Fmedium.com\u002Fchingu\u002Fan-introduction-to-environment-variables-and-how-to-use-them-f602f66d15fa",[33],"Nice piece on environment variables",[98,818,819],{},[29,820,823],{"href":821,"rel":822},"https:\u002F\u002Fgolang.org\u002Fcmd\u002Fgo\u002F",[33],"Go command line - learn about default env",[98,825,826],{},[29,827,830],{"href":828,"rel":829},"https:\u002F\u002Fdev.to\u002Filyakaznacheev\u002Fa-clean-way-to-pass-configs-in-a-go-application-1g64",[33],"Covers good ways to add configs",[11,832,833],{},"Awesome! You just learned how to manage configs in Golang. There are couple of other ways to manage configs in a better way, will cover them in some other article. I hope now you can easily add configs in your projects.",[11,835,836,837,842],{},"Liked the article? Consider ",[29,838,841],{"href":839,"rel":840},"https:\u002F\u002Fwww.buymeacoffee.com\u002FchHAzigTb",[33],"supporting me"," ☕️",[66,844],{},[11,846,847],{},"I hope you learned something new. Feel free to suggest improvements ✔️",[11,849,850,851,856],{},"I share regular updates and resources on ",[29,852,855],{"href":853,"rel":854},"https:\u002F\u002Ftwitter.com\u002Fmkfeuhrer",[33],"Twitter",". Let's connect!",[11,858,859],{},[40,860,861],{},"Keep exploring 🔎 Keep learning 🚀",[863,864,865],"style",{},"html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}",{"title":173,"searchDepth":258,"depth":258,"links":867},[868,869],{"id":23,"depth":258,"text":24},{"id":70,"depth":258,"text":71,"children":870},[871,872,873,874],{"id":78,"depth":265,"text":79},{"id":89,"depth":265,"text":90},{"id":149,"depth":265,"text":150},{"id":204,"depth":265,"text":205},[876,877],"Golang","Programming","Learn what are environment variables and how to use them in Go",false,"md","blog\u002Fenvironment-variable-golang\u002Fenvironment-variable-golang-card.webp","golang environment variable, golang envconfig, golang set environment variable , golang get environment variable",{},"environment-variable-golang","\u002Fblog\u002Fenvironment-variable-golang",{"title":5,"description":878},"blog\u002Fenvironment-variable-golang","2020-08-14","-2xd88saulyK_jlbl6mOyHkxKap8kR3g6krGJ8bFmMc",[891,898,904,912,921,928,935,942,948,954,960,962,968,978,984,991,998,1005,1011,1018,1024,1030,1036,1042,1048,1054,1060,1066,1073,1080,1086,1092,1098,1104,1110,1116,1122,1128,1134,1140,1146,1152,1158,1165,1171,1177,1183,1190,1196,1202,1209,1216,1222,1229,1235,1242,1248,1255,1261,1267,1273,1279,1285,1291,1297,1303,1309,1315,1321,1327,1334,1340,1347,1353,1359,1365,1372,1378],{"path":892,"title":893,"description":894,"categories":895,"draft":261,"year":897,"series":6},"\u002Fblog\u002Fai-assisted-workstation","Building an AI-Assisted Personal Workstation","How I built a personal AI workstation: markdown knowledge base, portable agent skills, handoff-driven sessions. What worked, what broke, what I would change.",[896,877],"Productivity","2026-08-26",{"path":899,"title":900,"description":901,"categories":902,"draft":879,"year":903,"series":6},"\u002Fblog\u002Faws-s3-golang","Uploading images to AWS S3 in Golang","In this tutorial I cover how to upload, fetch and manage other operations for objects on AWS S3 in Golang",[876,877],"2020-01-12",{"path":905,"title":906,"description":907,"categories":908,"draft":879,"year":911,"series":6},"\u002Fblog\u002Fbooks-for-engineers","Best Books for Software Engineers","Best Books to help you build you software engineering career - ranging from fundamentats, interview prep to productivity.",[909,910],"Books","Life","2021-12-26",{"path":913,"title":914,"description":915,"categories":916,"draft":879,"year":920,"series":6},"\u002Fblog\u002Fbuilding-acrons","Building Acrons 🚀","Building Acrons, a one-stop tool to decode everyday acronyms like DIY, FOMO, and BRB without losing your flow.",[917,918,919],"Side Projects","Web","Tools","2020-05-26",{"path":922,"title":923,"description":924,"categories":925,"draft":879,"year":927,"series":6},"\u002Fblog\u002Fcap-theorem","CAP Theorem Explained","Learn the concept and misconceptions around popular CAP theorem in system design.",[926,877],"System Design","2021-07-26",{"path":929,"title":930,"description":931,"categories":932,"draft":879,"year":934,"series":6},"\u002Fblog\u002Fcode-reviews","Code Review Checklist","Why code reviews matter, and best practices that catch bugs early and keep code quality high before merge.",[933],"Engineering Principles","2020-07-20",{"path":936,"title":937,"description":938,"categories":939,"draft":879,"year":941,"series":6},"\u002Fblog\u002Fdark-mode","Add Dark mode to websites","Dark mode is ❤️️ Add it to your websites with little CSS and JS",[940,918],"Javascript","2020-07-04",{"path":943,"title":944,"description":945,"categories":946,"draft":879,"year":947,"series":6},"\u002Fblog\u002Fdate-time-golang","Working with Date and Time in Go","Learn how to use time in Golang - Multiple formats, locations and using date.",[876,877],"2020-10-09",{"path":949,"title":950,"description":951,"categories":952,"draft":879,"year":953,"series":6},"\u002Fblog\u002Fdefer-in-golang","Understanding Defer In Golang","Learn about defer keyword in golang and how it can help you avoid panics due to bugs.",[876,877],"2021-05-05",{"path":955,"title":956,"description":957,"categories":958,"draft":879,"year":959,"series":6},"\u002Fblog\u002Fenums-golang","Implementing Enums in Golang","Enums are a way to defined set of constant values. Learn how to implement enums in Go using iota with examples.",[876,877],"2021-12-18",{"path":885,"title":5,"description":878,"categories":961,"draft":879,"year":888,"series":6},[876,877],{"path":963,"title":964,"description":965,"categories":966,"draft":879,"year":967,"series":6},"\u002Fblog\u002Ferror-handling-golang","Handle errors the right way — Golang","How to handle errors in golang to make your life easy",[876,877],"2020-01-30",{"path":969,"title":970,"description":971,"categories":972,"draft":261,"year":975,"series":976},"\u002Fblog\u002Ffile-attack-document-macros","File Attack Deep Dives, Part 3: Document Macros","How malicious VBA hides in vbaProject.bin, which AutoOpen entry points fire it, and the sandbox signals that catch it.",[973,974],"Security","Systems","2026-09-17",{"name":977,"part":265},"File Attack Deep Dives",{"path":979,"title":980,"description":981,"categories":982,"draft":879,"year":897,"series":983},"\u002Fblog\u002Ffile-attack-field-guide","How File-Based Attacks Land: A Detection Engineer's Field Guide","A practical taxonomy of how malware and phishing arrive as files, why classic controls miss them, and how detection should think.",[973,974],{"name":977,"part":180},{"path":985,"title":986,"description":987,"categories":988,"draft":261,"year":989,"series":990},"\u002Fblog\u002Ffile-attack-html-smuggling","File Attack Deep Dives, Part 2: HTML Smuggling","How attackers assemble malware inside the browser with Blob URLs, and the URL and script tells that catch it.",[973,974],"2026-09-10",{"name":977,"part":258},{"path":992,"title":993,"description":994,"categories":995,"draft":261,"year":996,"series":997},"\u002Fblog\u002Ffile-attack-lnk-iso","File Attack Deep Dives, Part 5: LNK and ISO Smuggling","How ISO containers and weaponized shortcuts bypass Mark of the Web, and the forensic fields that catch them.",[973,974],"2026-10-01",{"name":977,"part":287},{"path":999,"title":1000,"description":1001,"categories":1002,"draft":261,"year":1003,"series":1004},"\u002Fblog\u002Ffile-attack-pdf-url-actions","File Attack Deep Dives, Part 4: PDF URL Actions","How PDF OpenAction, Launch, and URI actions turn opening a document into a phishing click, and the action audit that catches them.",[973,974],"2026-09-24",{"name":977,"part":274},{"path":1006,"title":1007,"description":1008,"categories":1009,"draft":879,"year":1010,"series":6},"\u002Fblog\u002Ffile-upload-golang","Uploading Files in Golang with Multipart Request","Learn how to upload files from your client to server as a multipart request in Golang.",[876,877],"2021-03-13",{"path":1012,"title":1013,"description":1014,"categories":1015,"draft":879,"year":1017,"series":6},"\u002Fblog\u002Fgit-branch","Git Branch 101","Branching is a new path of development that makes it a lot easier to build features. Learn why and how to use branching in git.",[1016,877],"Git","2022-03-20",{"path":1019,"title":1020,"description":1021,"categories":1022,"draft":879,"year":1023,"series":6},"\u002Fblog\u002Fgit-pull-request-template","Guide to Pull Request Templates","Improve collaboration and code reviews with pull request templates. Blog include PR template and how to create one on github\u002Fgitlab",[1016,877],"2023-08-24",{"path":1025,"title":1026,"description":1027,"categories":1028,"draft":879,"year":1029,"series":6},"\u002Fblog\u002Fgit-remove-sensitive-info","Securing Git: Remove Sensitive Information","Protect your code from security breaches by using BFG tool to remove sensitive information from Git history. Learn how to do it in this comprehensive guide.",[1016,877],"2023-10-16",{"path":1031,"title":1032,"description":1033,"categories":1034,"draft":879,"year":1035,"series":6},"\u002Fblog\u002Fgit-tags-explained","Git tags : Explained","What Git tags are, why and when to use them, and how to start tagging releases in your own projects.",[1016,877],"2020-06-18",{"path":1037,"title":1038,"description":1039,"categories":1040,"draft":879,"year":1041,"series":6},"\u002Fblog\u002Fgo-dependency-injection","Dependency Injection in Go using Wire","Learn about dependency injection, its benefits and how to implement it in Go services using wire",[876,877],"2022-11-26",{"path":1043,"title":1044,"description":1045,"categories":1046,"draft":879,"year":1047,"series":6},"\u002Fblog\u002Fgo-generics","Introduction to Generics in Go","Learn about generics in Golang, it's benefits and how to implement it in applications.",[876,877],"2022-11-27",{"path":1049,"title":1050,"description":1051,"categories":1052,"draft":879,"year":1053,"series":6},"\u002Fblog\u002Fgo-in-memory-cache","Building In-Memory Cache in Go","Learn about in-memory caching in Golang, it's benefits and how to implement it with and without generics with a TTL(expiry).",[876,877],"2024-03-28",{"path":1055,"title":1056,"description":1057,"categories":1058,"draft":879,"year":1059,"series":6},"\u002Fblog\u002Fgo-makefile","Ultimate Makefile for Golang","Boost your productivity and save time with ultimate Makefile for Golang projects.",[876,877],"2024-06-10",{"path":1061,"title":1062,"description":1063,"categories":1064,"draft":879,"year":1065,"series":6},"\u002Fblog\u002Fgo-middleware","Mastering Middlewares in Golang","Learn about middlewares, their use cases and how to implement them in Golang applications",[876,877],"2022-03-13",{"path":1067,"title":1068,"description":1069,"categories":1070,"draft":879,"year":1072,"series":6},"\u002Fblog\u002Fgo-naming-conventions","Naming Conventions in Golang","Why naming conventions matter in Go, with best practices and practical examples for clear, readable, maintainable code.",[876,877,1071],"Code Quality","2023-05-19",{"path":1074,"title":1075,"description":1076,"categories":1077,"draft":879,"year":1079,"series":6},"\u002Fblog\u002Fgo-with-redis","Go with Redis","A practical introduction to using Redis with Golang to make your applications faster with in-memory data storage.",[876,1078,877],"Database","2020-05-03",{"path":1081,"title":1082,"description":1083,"categories":1084,"draft":879,"year":1085,"series":6},"\u002Fblog\u002Fgolang-maps","Learn Maps in Golang (with examples)","A complete guide to maps in Golang: creating maps, adding and removing items, iterating, and how map equality works.",[876,877],"2020-09-10",{"path":1087,"title":1088,"description":1089,"categories":1090,"draft":879,"year":1091,"series":6},"\u002Fblog\u002Fguide-to-cdn","Guide to Content Delivery Network","CDN is one of the backbone of modern world internet infrastructure. Learn about Content Delivery Network, it's working, types and benefits.",[926,877],"2022-01-23",{"path":1093,"title":1094,"description":1095,"categories":1096,"draft":879,"year":1097,"series":6},"\u002Fblog\u002Fguide-to-rule-engines","Guide to Rule Engines","Rule Engines help in solving changing business requirements with ease. Learn all about Rule engines, it's working, benefits and how to implement one in Golang",[876,877],"2022-09-12",{"path":1099,"title":1100,"description":1101,"categories":1102,"draft":879,"year":1103,"series":6},"\u002Fblog\u002Fhexagonal-architecture","Guide to Hexagonal Architecture","Learn how to design efficient application with hexagonal architecture with practical example",[926,877],"2020-12-13",{"path":1105,"title":1106,"description":1107,"categories":1108,"draft":879,"year":1109,"series":6},"\u002Fblog\u002Fhttp-status-codes","Learn HTTP Status Codes","A tour of HTTP response status codes, what each class means, and when to use which code in your applications.",[918,877],"2020-07-30",{"path":1111,"title":1112,"description":1113,"categories":1114,"draft":879,"year":1115,"series":6},"\u002Fblog\u002Fintroduction-to-goroutines","Introduction to Goroutines","Understand the basics of concurrency and learn how to work with Goroutines in golang.",[876,877],"2021-04-10",{"path":1117,"title":1118,"description":1119,"categories":1120,"draft":879,"year":1121,"series":6},"\u002Fblog\u002Fjson-in-postgres-with-golang","Storing JSON in Postgres with Golang","Learn how to store JSON objects in Postgres and how to implement it in Golang.",[877,1078,876],"2021-02-13",{"path":1123,"title":1124,"description":1125,"categories":1126,"draft":879,"year":1127,"series":6},"\u002Fblog\u002Fjson-web-token","Complete Guide to JWT","JSON Web Tokens are a very compact way to carry information. Learn about JWTs in depth, from its structure to when to use it.",[877,918],"2021-11-20",{"path":1129,"title":1130,"description":1131,"categories":1132,"draft":879,"year":1133,"series":6},"\u002Fblog\u002Flearn-to-say-no","Learning to say No","Learn why it's important to say 'NO'. How it helps in increasing productivity and explore strategies for saying No",[910,909],"2022-04-09",{"path":1135,"title":1136,"description":1137,"categories":1138,"draft":879,"year":1139,"series":6},"\u002Fblog\u002Flearn-unlearn-relearn","Learn - Unlearn - Relearn","Unlearning things to learn new is the way to grow. Discover how to do that!",[896,910],"2020-09-25",{"path":1141,"title":1142,"description":1143,"categories":1144,"draft":879,"year":1145,"series":6},"\u002Fblog\u002Flinting-in-golang","Introduction to Linting in Go","Introduction to improving code quality using linting. Learn how to add linting in your Go projects.",[876,877],"2021-07-07",{"path":1147,"title":1148,"description":1149,"categories":1150,"draft":879,"year":1151,"series":6},"\u002Fblog\u002Fload-balancing","Load Balancing 101","Complete guide on load balancers explaining the internal working and how does it help in making applications efficient.",[926,877],"2021-05-29",{"path":1153,"title":1154,"description":1155,"categories":1156,"draft":879,"year":1157,"series":6},"\u002Fblog\u002Fmaking-decisions-the-right-way","Making Decisions: The right way","Decisions are hard! Learn how to make the right decisions always",[896,910],"2020-06-07",{"path":1159,"title":1160,"description":1161,"categories":1162,"draft":879,"year":1164,"series":6},"\u002Fblog\u002Fmanage-logs-with-logrotate","Using Logrotate to manage logs","Learn how to use logrotate system utility to manage logs with example",[1163,877],"Linux","2020-09-08",{"path":1166,"title":1167,"description":1168,"categories":1169,"draft":879,"year":1170,"series":6},"\u002Fblog\u002Fmarshal-structs-golang","Marshal structs the right way: Golang","Why Golang marshals empty structs into your JSON instead of null, and how to marshal structs the right way.",[876,877],"2020-03-31",{"path":1172,"title":1173,"description":1174,"categories":1175,"draft":879,"year":1176,"series":6},"\u002Fblog\u002Fnotes-almanack-naval","Book Notes : Almanack of Naval Ravikant","My notes\u002Fhighlights from Almanack of Naval Ravikant book by Eric Jorgenson",[909,910],"2020-10-17",{"path":1178,"title":1179,"description":1180,"categories":1181,"draft":879,"year":1182,"series":6},"\u002Fblog\u002Fnotes-anything-you-want","Book Notes : Anything you want","My notes\u002Fhighlights from Anything you want book by Derek Sivers",[909,910],"2021-09-25",{"path":1184,"title":1185,"description":1186,"categories":1187,"draft":879,"year":1189,"series":6},"\u002Fblog\u002Fnotes-getting-real","Book Notes : Getting Real","My notes and highlights from Getting Real by Jason Fried and David Heinemeier Hansson on building web applications.",[909,1188],"Startups","2020-11-03",{"path":1191,"title":1192,"description":1193,"categories":1194,"draft":879,"year":1195,"series":6},"\u002Fblog\u002Fnotes-hell-yeah-or-no","Book Notes : Hell Yeah or No","My notes\u002Fhighlights from Hell Yeah or No book by Derek Sivers",[909,910],"2020-09-16",{"path":1197,"title":1198,"description":1199,"categories":1200,"draft":879,"year":1201,"series":6},"\u002Fblog\u002Fnotes-how-to-be-a-capitalist","Book Notes : How to Be a Capitalist Without Any Capital","My notes\u002Fhighlights from How to Be a Capitalist Without Any Capital by Nathan Latka",[909,1188],"2020-01-07",{"path":1203,"title":1204,"description":1205,"categories":1206,"draft":879,"year":1208,"series":6},"\u002Fblog\u002Fnotes-lean-b2b","Book Notes : Lean B2B","My notes and highlights from Lean B2B by Étienne Garbugli on assessing markets, building MVPs, and selling to businesses.",[909,1207],"Entrepreneurship","2022-07-02",{"path":1210,"title":1211,"description":1212,"categories":1213,"draft":879,"year":1215,"series":6},"\u002Fblog\u002Fnotes-lets-talk-money","Book Notes : Let's Talk Money","My notes and highlights from Let's Talk Money by Monica Halan on managing personal finances and savings.",[909,1214],"Personal Finance","2021-02-26",{"path":1217,"title":1218,"description":1219,"categories":1220,"draft":879,"year":1221,"series":6},"\u002Fblog\u002Fnotes-obviously-awesome","Book Notes : Obviously Awesome","My notes and highlights from Obviously Awesome by April Dunford on product positioning and marketing strategy.",[909,1188],"2020-04-26",{"path":1223,"title":1224,"description":1225,"categories":1226,"draft":879,"year":1228,"series":6},"\u002Fblog\u002Fnotes-refactoring-ui","Book Notes: Refactoring UI","My notes and highlights from Refactoring UI by Adam Wathan and Steve Schoger, full of practical design tips for engineers.",[909,1227],"Design","2020-05-09",{"path":1230,"title":1231,"description":1232,"categories":1233,"draft":879,"year":1234,"series":6},"\u002Fblog\u002Fnotes-rework","Book Notes: Rework","My notes and highlights from Rework by Jason Fried and David Heinemeier Hansson on a better way to succeed in business.",[909,1188],"2021-04-14",{"path":1236,"title":1237,"description":1238,"categories":1239,"draft":879,"year":1241,"series":6},"\u002Fblog\u002Fone-on-one-meetings","Guide to Effective 1:1 Meetings","One on One meetings are important for your personal & professional growth. Learn how to master 1:1s with your manager and peers.",[1240,896],"Career","2023-03-05",{"path":1243,"title":1244,"description":1245,"categories":1246,"draft":879,"year":1247,"series":6},"\u002Fblog\u002Fpersonal-okrs","Personal OKRs for Success","Why one should set personal OKRs and how to achieve success with them",[896,910],"2020-06-27",{"path":1249,"title":1250,"description":1251,"categories":1252,"draft":879,"year":1254,"series":6},"\u002Fblog\u002Fpoker-tips","Poker Tips: Johns Hopkins Poker Class","Notes from Johns Hopkins poker course. This guide will help you improve in Poker and win some large pots.",[910,1253],"Poker","2020-06-13",{"path":1256,"title":1257,"description":1258,"categories":1259,"draft":879,"year":1260,"series":6},"\u002Fblog\u002Fpomodoro","Get work done: The Pomo Way","Learn to focus and get productive by following the Pomodoro Technique",[896],"2020-10-24",{"path":1262,"title":1263,"description":1264,"categories":1265,"draft":879,"year":1266,"series":6},"\u002Fblog\u002Fpostgres-constraints","Postgres Constraints","Constraints are line of defense for database. Explore various types of constrainsts in postgres",[1078,877],"2020-11-07",{"path":1268,"title":1269,"description":1270,"categories":1271,"draft":879,"year":1272,"series":6},"\u002Fblog\u002Fppf-explained","PPF Explained","Learn basics about Public Provident Fund and why you should invest",[910,1214],"2020-12-24",{"path":1274,"title":1275,"description":1276,"categories":1277,"draft":879,"year":1278,"series":6},"\u002Fblog\u002Fproductivity-chrome-extensions","Boost Productivity with Chrome Extensions","Utitizing chrome extensions to boost your productivity!",[896,919,918],"2020-04-24",{"path":1280,"title":1281,"description":1282,"categories":1283,"draft":879,"year":1284,"series":6},"\u002Fblog\u002Fproductivity-in-vscode","Improve your productivity with VS Code","Key VS Code features like the integrated terminal, shortcuts, and extensions that improved my everyday productivity.",[896,877],"2020-03-12",{"path":1286,"title":1287,"description":1288,"categories":1289,"draft":879,"year":1290,"series":6},"\u002Fblog\u002Freading-101","Improving Reading 101","Why reading matters, how to build a reading habit, and what to read next - from my own journey into books.",[909,910],"2020-04-04",{"path":1292,"title":1293,"description":1294,"categories":1295,"draft":879,"year":1296,"series":6},"\u002Fblog\u002Freverse-proxy","Understanding Reverse Proxy","Learn about reverse proxy, how it is different from forward proxy and explore advantages of using it in system design.",[926,877],"2021-10-03",{"path":1298,"title":1299,"description":1300,"categories":1301,"draft":879,"year":1302,"series":6},"\u002Fblog\u002Frunning-periodic-background-task-golang","Running periodic background tasks in Golang","How to run periodic background tasks in Golang by combining cron-style scheduling with background execution.",[876,877],"2019-11-21",{"path":1304,"title":1305,"description":1306,"categories":1307,"draft":879,"year":1308,"series":6},"\u002Fblog\u002Fsessions-in-golang","Sessions using Golang and Redis","How cookies and sessions work, and how to implement persistent login sessions in Golang using Redis.",[876,1078,877],"2020-02-25",{"path":1310,"title":1311,"description":1312,"categories":1313,"draft":879,"year":1314,"series":6},"\u002Fblog\u002Fsolid-dry-kiss-yagni","Solid Dry Kiss Yagni","An introduction to the SOLID, DRY, KISS, and YAGNI principles and how they help you write cleaner, robust code.",[933],"2020-07-17",{"path":1316,"title":1317,"description":1318,"categories":1319,"draft":879,"year":1320,"series":6},"\u002Fblog\u002Fstack-in-golang","Implement Stack in Golang","Learn how to implement stack data structure in Golang (Full code)",[876,877],"2020-09-14",{"path":1322,"title":1323,"description":1324,"categories":1325,"draft":879,"year":1326,"series":6},"\u002Fblog\u002Fstart-oss-today","Start your Open Source journey today","Start your OSS journey with intro to GIT. Participate in Hacktoberfest!",[1016,877],"2020-09-19",{"path":1328,"title":1329,"description":1330,"categories":1331,"draft":879,"year":1333,"series":6},"\u002Fblog\u002Fsticky-social-bar","Sticky social share component in HTML","Learn how to build a social media sharing component in HTML and add it to your website.",[877,1332],"Frontend","2021-02-05",{"path":1335,"title":1336,"description":1337,"categories":1338,"draft":879,"year":1339,"series":6},"\u002Fblog\u002Fterm-insurance","Term insurance Simplified","Everything you need to know before you buy a term insurance.",[910,1214],"2020-11-29",{"path":1341,"title":1342,"description":1343,"categories":1344,"draft":879,"year":1346,"series":6},"\u002Fblog\u002Fterminal-output-with-redirection","Handling terminal outputs with Redirection","Learn how to handle terminal outputs with Redirection and saving it to files",[1163,1345,877],"Terminal","2020-09-06",{"path":1348,"title":1349,"description":1350,"categories":1351,"draft":879,"year":1352,"series":6},"\u002Fblog\u002Fthink-and-grow-rich","Book Notes: Think and Grow Rich","My notes and highlights from Think and Grow Rich by Napoleon Hill, covering its process for building wealth.",[909,910],"2020-05-19",{"path":1354,"title":1355,"description":1356,"categories":1357,"draft":879,"year":1358,"series":6},"\u002Fblog\u002Ftransactions-postgres-golang","Transactions on Postgres with Golang","Performing Postgres database operations in Golang with GORM, from basic queries to full transaction support.",[876,1078,877],"2020-03-18",{"path":1360,"title":1361,"description":1362,"categories":1363,"draft":879,"year":1364,"series":6},"\u002Fblog\u002Fwaitgroups-in-golang","WaitGroups in Golang","Learn about WaitGroups in golang and how to use them to perform concurrent operations without blocking the main thread.",[876,877],"2022-05-31",{"path":1366,"title":1367,"description":1368,"categories":1369,"draft":879,"year":1371,"series":6},"\u002Fblog\u002Fwhat-i-use","What I Use: Products and Softwares","List of what I use in my day to day life ranging from terminal, editors, softwares, devices to accessories",[910,1370],"Tech","2024-06-01",{"path":1373,"title":1374,"description":1375,"categories":1376,"draft":879,"year":1377,"series":6},"\u002Fblog\u002Fyear-in-review-2020","Year in Review: 2020","It's a wrap! 2020 was a crazy year, See how my year went!",[910],"2020-12-31",{"path":1379,"title":1380,"description":1381,"categories":1382,"draft":879,"year":1383,"series":6},"\u002Fblog\u002Fyear-in-review-2021","Year in Review: 2021","It's a wrap! 2021 was a mixed bag, full of ups and downs. Key Goal for 2022: Start now!",[910],"2021-12-31",1788633832094]