Previously we’ve seen how to construct basic HTTP request and response with our simple TCP server. In this blog post we’ll go a bit deeper into the Content-Type header and see Content-Type in action. This is specifically HTTP thing. So when we’re sending data to an HTTP client we can specify what type of data we’re sending by using a header cal... Read more 28 Dec 2024 - 7 minute read
Table Of Contents Creating a TCP Server What if we try to connect with an http client? Parsing the request and sending a response Next The goal of this blog post is to spin up a TCP server and start sending requests to the server with various clients. That way we’ll see what type of data an HTTP client like curl sends to the server. O... Read more 12 Dec 2024 - 12 minute read
Table Of Content Table Of Content log/slog A very basic example Configuration Wrapping Writing to file Tips So you want to use the new shiny structured logging library in golang log/slog slog (a structured logging library in Go) has been included in the Go standard library starting from version 1.21. While Go already had a lo... Read more 14 Sep 2023 - 4 minute read
Disclaimer: This article is not about runtime/trace package or trace profiling functionalities. Tracing is used to observe code execution paths. If you log something in a function and you see that output in the log file, then you know that the function has been executed. There is a log level defined in different logger implementations called TR... Read more 20 Aug 2023 - 2 minute read
Table Of Contents Graceful Shutdown What are signals in OS context? An Example Program An automated way to send signals What are the available signals? SIGINT SIGTERM SIGKILL Why did we initialize the sigCh as buffered channel? Signal Broadcast ... Read more 11 Mar 2023 - 15 minute read