<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Go on Ecostack</title>
    <link>https://ecostack.dev/categories/go/</link>
    <description>Recent content in Go on Ecostack</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <copyright>© 2026 Sebastian Scheibe</copyright>
    <lastBuildDate>Fri, 02 May 2025 16:05:19 +0800</lastBuildDate><atom:link href="https://ecostack.dev/categories/go/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Fixed Window Rate Limit with Golang &amp; Redis</title>
      <link>https://ecostack.dev/posts/fixed-window-rate-limit-golang-redis/</link>
      <pubDate>Fri, 02 May 2025 16:05:19 +0800</pubDate>
      
      <guid>https://ecostack.dev/posts/fixed-window-rate-limit-golang-redis/</guid>
      <description>Introduction #   Imagine you have a resource that can only handle a limited number of requests per second.
How do you ensure it doesn’t get overwhelmed?
One solution is rate-limiting — controlling how many requests are allowed in a given time frame.
In this article, I’ll show how to implement a simple rate limiter using Redis and Golang.
Rate-Limiting Algorithms #   There are several types of rate-limiting algorithms — two common ones are fixed-window and token bucket.</description>
      <media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://ecostack.dev/posts/fixed-window-rate-limit-golang-redis/featured.webp" />
    </item>
    
    <item>
      <title>Golang Error: missing Location in call to Time.In</title>
      <link>https://ecostack.dev/posts/golang-error-missing-location-in-call-to-time-in/</link>
      <pubDate>Mon, 04 Mar 2024 08:24:25 +0800</pubDate>
      
      <guid>https://ecostack.dev/posts/golang-error-missing-location-in-call-to-time-in/</guid>
      <description>The Problem #   Did you ever have any of these errors?
 missing Location in call to Time.In missing Location in call to Date  panic: time: missing Location in call to Time.In goroutine 1 [running]: time.Time.In(...) /usr/local/go/src/time/time.go:1146 main.main() /app/main.go:16 +0x1c5 Does your code look somewhat like this?
location, _ := time.LoadLocation(&amp;#34;Europe/Amsterdam&amp;#34;) name, offset := time.Now().In(location).Zone() log.Println(&amp;#34;name: &amp;#34;+name, &amp;#34;offset: &amp;#34;+strconv.Itoa(offset)) Are you using Alpine or a similar distribution in your Docker container?</description>
      <media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://ecostack.dev/posts/golang-error-missing-location-in-call-to-time-in/featured.webp" />
    </item>
    
    <item>
      <title>Golang Integer to String</title>
      <link>https://ecostack.dev/posts/golang-int-to-string/</link>
      <pubDate>Tue, 08 Aug 2023 23:11:10 +0800</pubDate>
      
      <guid>https://ecostack.dev/posts/golang-int-to-string/</guid>
      <description>The Go standard library offers the strconv package which has two functions to convert an integer to a string. In the following, let&amp;rsquo;s go into detail on how and where to use which one.
 strconv.Itoa(i int) string  strconv.FormatInt(i int64, base int) string   For converting an integer to a string, the strconv.Atoi(s string) is the best method.
 strconv.Atoi(s string) string   Integer to String #   strconv.</description>
      <media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://ecostack.dev/posts/golang-int-to-string/featured.webp" />
    </item>
    
    <item>
      <title>Go: Cross-Compilation Including Cgo</title>
      <link>https://ecostack.dev/posts/go-and-cgo-cross-compilation/</link>
      <pubDate>Wed, 16 Nov 2022 23:51:02 +0800</pubDate>
      
      <guid>https://ecostack.dev/posts/go-and-cgo-cross-compilation/</guid>
      <description>Updated on 2023-05-24: Added information on cross-compiling using the MUSL and GNU toolchain on macOS for static linking.
Updated on 2025-01-08: Updating the parameters for static linking.
Introduction #   With the release of Go v1.5, it became possible to cross-compile applications for various targets such as Windows, macOS, Linux, Solaris, and Android. Cross-compilation allows you to build binaries for different operating systems from a single development machine. This article explains how to cross-compile Go applications, including those that use Cgo for C dependencies.</description>
      <media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://ecostack.dev/posts/go-and-cgo-cross-compilation/featured.webp" />
    </item>
    
    <item>
      <title>Golang Errors With Stacktrace</title>
      <link>https://ecostack.dev/posts/go-errors-with-stacktrace/</link>
      <pubDate>Sat, 04 Jun 2022 00:09:16 +0800</pubDate>
      
      <guid>https://ecostack.dev/posts/go-errors-with-stacktrace/</guid>
      <description>Problem #   The error handling of Go is not up to snuff compared to other languages like Java for example. Errors are treated equally to other values, meaning, they have no special type. This means, they do not carry information of origin in them. Which makes tracking down the error origin more difficult.
Let me show that to you.
package main import ( &amp;#34;errors&amp;#34; &amp;#34;fmt&amp;#34; ) func main() { err := NewErrorWithStackTrace() if err !</description>
      <media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://ecostack.dev/posts/go-errors-with-stacktrace/featured.webp" />
    </item>
    
    <item>
      <title>Golang Generic Option Type</title>
      <link>https://ecostack.dev/posts/go-generic-option-type/</link>
      <pubDate>Fri, 03 Jun 2022 22:53:54 +0800</pubDate>
      
      <guid>https://ecostack.dev/posts/go-generic-option-type/</guid>
      <description>Introduction #   You might have heard of the Option type, if not, let me introduce that concept shortly.
An Option type is data structure which either has a value or no value contained in itself, it kind of acts as a box (Schrödinger&amp;rsquo;s cat 😉). Usually, the Option type is created with a constructor such as Some(value) or None(). From there, the type usually offers methods which can act in case a value exists.</description>
      <media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://ecostack.dev/posts/go-generic-option-type/featured.webp" />
    </item>
    
    <item>
      <title>Go Goroutine Loop Variables: Before and After Go 1.22</title>
      <link>https://ecostack.dev/posts/goroutine-variable-scope/</link>
      <pubDate>Sun, 29 May 2022 00:01:06 +0000</pubDate>
      
      <guid>https://ecostack.dev/posts/goroutine-variable-scope/</guid>
      <description>A goroutine can capture a variable from the surrounding function. Whether a loop gives each goroutine a separate variable depends on how that variable is declared and which Go language version the package uses.
For modules declaring go 1.22 or later, variables declared by a loop have a new instance on each iteration. The common loop-capture bug shown in older Go tutorials therefore no longer applies to those declarations. Variables declared outside the loop can still be shared.</description>
      <media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://ecostack.dev/posts/goroutine-variable-scope/featured.webp" />
    </item>
    
  </channel>
</rss>
