<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Gabriel Santos on Medium]]></title>
        <description><![CDATA[Stories by Gabriel Santos on Medium]]></description>
        <link>https://medium.com/@gabrieldevel?source=rss-23f8f30948bf------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*XBiHGNc3kpwo9IdXswm5hw.jpeg</url>
            <title>Stories by Gabriel Santos on Medium</title>
            <link>https://medium.com/@gabrieldevel?source=rss-23f8f30948bf------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 11:18:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gabrieldevel/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[AWS SDK for Go: How to Use It]]></title>
            <link>https://gabrieldevel.medium.com/aws-sdk-for-go-how-to-use-it-9c4905d160b8?source=rss-23f8f30948bf------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c4905d160b8</guid>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[golang-tutorial]]></category>
            <category><![CDATA[dynamodb]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Gabriel Santos]]></dc:creator>
            <pubDate>Sun, 25 Jan 2026 19:03:42 GMT</pubDate>
            <atom:updated>2026-01-25T19:03:42.663Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8dgXG2t2ax9Q7d9SsnawDg.png" /></figure><p>Cloud computing has become an important part of everyday life, given that scalable systems are becoming not only increasingly common but also necessary in daily routines. Putting a system in the cloud has become one of the easiest and cheapest ways to scale these applications, so cloud solutions have become increasingly abundant in recent years, offering more and more solutions. This is the case with big tech companies like Google, Microsoft, and Amazon, which offer cloud services such as Google Cloud, Azure, and AWS.</p><p>Other companies also offer hosting services, virtual machines, or VPS, but big tech companies have become the largest in this field because they are big tech companies and it’s impossible to compete with them. (What can you do, right?)</p><p>Among these facts, another one stands out: the Go programming language, which is becoming increasingly common today, being used to create systems and microservices, which in turn are usually hosted in the cloud. So, knowing Go and cloud computing becomes a tool that fits both hands, an essential combination for the Go-lang developer.</p><p>Therefore, in this quick article I will show how to integrate with AWS, with examples of real functions used in projects using the AWS SDK for Go v2, which brings performance and typing improvements compared to the first version.</p><h3>Credentials</h3><p>AWS credentials are the key for it to know who you are and which services and account you will have access to; it’s your API KEY. Without them, you won’t be able to access AWS services.</p><p>There are only two credentials: aws_access_key_id and aws_secret_access_key.</p><p>They can be accessed through the SDK from a folder in the root directory, or through environments. But for this example I will use the folder method because that’s the method I used.</p><p>The credentials must be in a folder named .aws in the root directory of the machine. Inside this folder, there must be a file called credentials, whose content should be:</p><pre>[default]<br>aws_access_key_id = &lt;your_aws_access_key_id&gt;<br>aws_secret_access_key = &lt;your_aws_secret_access_key&gt;</pre><p>In the fields between &lt;&gt; you must put your credentials so that the SDK can find and connect to your account.</p><p>To access your credentials, you can follow these steps:</p><ul><li>Open the IAM console.</li><li>In the navigation menu, choose Users.</li><li>Select your IAM username (not the checkbox).</li><li>Open the Security credentials tab and then choose Create access key.</li><li>To view the new access key, choose Show. Your credentials resemble the following:</li></ul><pre>Access Key ID: AKIAIOSFODNN7EXAMPLE<br>Secret Access Key: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY</pre><ul><li>To download the key pair, choose Download .csv file. Store the keys in a secure location.</li></ul><p>See more about downloading your credentials at: <a href="https://docs.aws.amazon.com/sdk-for-go/v2/developer-guide/getting-started.html">https://docs.aws.amazon.com/sdk-for-go/v2/developer-guide/getting-started.html</a></p><h3>Configuration</h3><p>With your credentials in hand and in the correct place, it’s time to finally configure the code that will read them and then execute their functions. This code can be written as follows:</p><pre>import &quot;context&quot;<br>import &quot;github.com/aws/aws-sdk-go-v2/config&quot;<br>// …<br>cfg, err := config.LoadDefaultConfig(context.TODO(),<br>config.WithRegion(&quot;us-west-2&quot;),<br>) if err != nil {<br>// handle error<br>}</pre><p>We start by importing the SDK configuration package, and then we call the LoadDefaultConfig function, passing a context as an argument. Note that for this example, we added an extra parameter specifying the region. This region is the region where you chose to host your account when you created it. You can specify this region and other information through another file in the same .aws folder, named config, and the following file:</p><pre>[default]<br>region = us-east-2</pre><p>This way, AWS will know exactly your region and credentials, and will be able to connect to your account.</p><p>But now, I have everything ready, and there were no errors when I connected the AWS SDK in the code, how do I call the AWS service functions? That’s what I’m going to show you now, with code examples of integration with AWS DynamoDB.</p><h3>Using DynamoDB</h3><pre>package main<br><br>import &quot;github.com/aws/aws-sdk-go-v2/service/dynamodb&quot;<br><br>func main() {<br><br>  DynamoClient = dynamodb.NewFromConfig(cfg)<br><br>}</pre><p>Above we can see an example of how to use cfg as a configuration for AWS services. All services will have a function whose parameter is cfg, which in turn will be used in the functions that directly access each service.</p><pre>// GetFile.go<br><br>package getFile<br><br>import ( <br>  &quot;context&quot; <br>  &quot;encoding/json&quot; <br>  &quot;log&quot;<br>  &quot;github.com/aws/aws-sdk-go-v2/aws&quot; <br>  &quot;github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue&quot; <br>  &quot;github.com/aws/aws-sdk-go-v2/service/dynamodb&quot;<br>  model &quot;github.com/Grs2080w/grp_server/core/db/dynamo/files/.model&quot;<br>)<br><br>type TableBasics struct { <br>  DynamoDbClient *dynamodb.Client <br>  TableName string<br>}<br><br>func (basics *TableBasics) GetFile(ctx context.Context, pk string, sk string) (string, error) { <br>  file := model.Files{ <br>    Pk: pk, <br>    Sk: sk, <br>  }<br><br>  response, err := basics.DynamoDbClient.GetItem(ctx, &amp;dynamodb.GetItemInput{ <br>    Key: file.GetKey(), <br>    TableName: aws.String(basics.TableName), <br>  })<br><br>  if err != nil { <br>    log.Printf(&quot;Couldn&#39;t get info about %v. Here&#39;s why: %v\n&quot;, pk, err) <br><br>  } else { <br><br>    err = attributevalue.UnmarshalMap(response.Item, &amp;file) <br>  <br>    if err != nil { <br>      log.Printf(&quot;Couldn&#39;t unmarshal response. Here&#39;s why: %v\n&quot;, err) <br>     } <br>  }<br><br>  return file, error<br><br>}</pre><p>In the example above, we see an example of how to call the AWS SDK, using the config we have already created. Didn’t think so? Let me explain: the following file implements a “class” in Go, and a function that directly accesses the SDK. This class has the constructors DynamoDbClient and TableName. DynamoDbClient is the same function we configured in the previous example, responsible for connecting to the SDK with credentials. It will be passed when the struct is instantiated, and will be accessed by the GetFile function through an internal method. The GetFile function will access the database used by DynamoDbClient and return the metadata of a file, which in turn will be transformed into JSON before being actually returned.</p><p>It’s important to note that the name DynamoDbClient doesn’t mean that a different configuration should be made for each service, only that each service has a different way of calling and reading the same configuration.</p><p>Below is a real code example that uses the function from the previous example:</p><pre>package getFile<br><br>import (<br>  &quot;context&quot;<br>  &quot;log&quot;<br>  &quot;github.com/gin-gonic/gin&quot;<br>  &quot;github.com/Grs2080w/grp_server/core/db/dynamo/clientDb&quot;<br>  get &quot;github.com/Grs2080w/grp_server/core/db/dynamo/files/getFile&quot;<br>  &quot;github.com/Grs2080w/grp_server/core/domains/files/getFile&quot;<br>)<br><br>func GetFileHandler(c *gin.Context) {<br><br>  username := c.GetString(&quot;username&quot;)<br>  <br>  var userRequest getFile.UserRequest<br>  <br>  if err := c.ShouldBindJSON(&amp;userRequest); err != nil { <br>    log.Println(err) <br>    c.JSON(400, gin.H{&quot;error&quot;: err.Error()}) <br>    return <br>  }<br>  err := userRequest.Validate() <br>  <br>  if err != nil { <br>    log.Println(err) <br>    c.JSON(400, gin.H{&quot;error&quot;: err.Error()}) <br>    return <br>  }<br>  <br>  file, err := (&amp;get.TableBasics{DynamoDbClient: clientDb.CDB.DynamoClient, TableName: clientDb.CDB.TableName}).GetFile(context.TODO(), username + &quot;#FILES&quot;, &quot;FILES#&quot; + userRequest.Filename)<br>  <br>  if err != nil { <br>    log.Printf(&quot;Failed to get file: %v&quot;, err) <br>    c.JSON(500, gin.H{&quot;error&quot;: &quot;error on searching file&quot;})<br>    return<br>  }<br>  <br>  fileParsed, err := getFile.ParseFile(file)<br>  <br>  if err != nil {<br>    log.Println(err)<br>    c.JSON(500, gin.H{&quot;error&quot;: &quot;an unexpected error occurred&quot;})<br>    return<br>  }<br>  <br>  c.JSON(200, fileParsed)<br>}</pre><p>In this example, you can see that the GetFile function is called as a method of TableBasics, and as an argument to the instance, we pass the DynamoClient which internally calls the cfg. Thus, the function accesses the table, whose name we also passed as an argument to TableBasics, and returns the values ​​we want.</p><h3>Conclusion</h3><p>This article showed how to get AWS credentials, use them to create the cfg, and use the cfg to use the desired SDK function. I hope this article has helped anyone who has ever had difficulty with this subject. See you later!</p><h3>References</h3><p>Amazon Web Services (AWS). (n.d.). DynamoDB code examples. In AWS SDK for Go V2 Developer Guide. Accessed 1/25/2026, from <a href="https://docs.aws.amazon.com/sdk-for-go/v2/developer-guide/go_dynamodb_code_examples.html">https://docs.aws.amazon.com/sdk-for-go/v2/developer-guide/go_dynamodb_code_examples.html</a></p><p>Amazon Web Services (AWS). (n.d.). Getting started. In AWS SDK for Go V2 Developer Guide. Accessed 1/25/2026, from <a href="https://docs.aws.amazon.com/sdk-for-go/v2/developer-guide/getting-started.html">https://docs.aws.amazon.com/sdk-for-go/v2/developer-guide/getting-started.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c4905d160b8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to fix import cycle in Go]]></title>
            <link>https://gabrieldevel.medium.com/how-to-fix-import-cycle-in-go-f2fb3457685b?source=rss-23f8f30948bf------2</link>
            <guid isPermaLink="false">https://medium.com/p/f2fb3457685b</guid>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[erros]]></category>
            <category><![CDATA[issues]]></category>
            <dc:creator><![CDATA[Gabriel Santos]]></dc:creator>
            <pubDate>Tue, 20 Jan 2026 18:22:12 GMT</pubDate>
            <atom:updated>2026-01-20T19:00:32.946Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*E97oz8qLngDlR6u51-r1_g.png" /></figure><p>I was modularizing a small project in Go and for the first time I encountered an “import cycle not allowed” message. I spent a good amount of time looking for solutions to this problem and racking my brain over the various levels of complexity it can have. So today I’m going to demonstrate the solutions I found, my opinion on each one, and why Go is actually teaching us a lesson.</p><h3>The Problem</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9RtbsEfBQ4sAx0Pm2H6sfQ.png" /></figure><p>The “import cycle not allowed” error occurs when two or more packages import modules from each other, leading to an infinite, circular import cycle. The Go compiler natively blocks this behavior because with an import cycle it wouldn’t know which file to render first, since the initialization order of packages is determined by the dependency graph, but if one depends on the other, where to start?</p><h3>Go is giving us a lesson.</h3><p>The Go compiler doesn’t block import cycles simply because it wouldn’t know how to handle them (Well… maybe that’s the main reason). But also because the Go language values ​​simplicity, clarity, compilation performance, and building robust modular systems. In other languages ​​(like Java or Python), import cycles are allowed or handled more permissively, which often leads to the so-called “Big Ball of Mud”. By prohibiting you from compiling code with import cycles, it’s pushing the Directed Acyclic Graph (DAG) principle into your code, which in this context dictates that in a file tree, imports can only occur from one file to another, never in both directions, in order to ensure that a cycle doesn’t occur.</p><p>The DAG concept is used in other social fields such as mathematics, biology (evolution, family trees, epidemiology), and information science. In biology, every family tree is a representation of the concept of DAG (Directed Gestalt Array), and consanguinity is demonstrably a real risk for birth defects in subsequent human beings (Just like our code if Go allowed it to compile!). I could cite more examples of DAG implementation, but that would make this too long. The fact is that Go is not only giving us a technical limitation, it is teaching us a fundamental law of life.</p><h3>Solutions</h3><p>Considering the problem and its causes, let’s talk about solutions to ensure code continuity according to Go principles, in descending order of complexity.</p><h3>Dependency Inversion</h3><p>This approach involves “tricking” one of the modules into replacing the one that should be imported. This method is one of the most complex to understand initially, but after some thought it becomes easy to grasp.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yv4UNJx3PE8ypeViylr4cA.png" /></figure><p>In this example, package 1 needs a function from package 2, which depends on a struct from package 1 for its typing, resulting in an import cycle. To solve this, we create a second file for package 2 (or it can be in the same file), and introduce an interface that defines the expected behavior of the struct from package 1.</p><p>We also create a Map, of the type that receives a string as its key and a function as its value, the same function that package 1 will use. For package 1 to use the function from package 2, it only needs to import the map from package 2 and access the function, passing the struct with the correct methods as a parameter. Thus, package 2 no longer depends on package 1 for typing, only on itself, resulting in a dependency inversion.</p><p>This solution is only possible because in Go an interface can be satisfied by any concrete type (struct, int, string, etc.) that implements all the methods defined in that interface, without the need for an explicit declaration. This means you don’t need to say “this struct x implements the interface y”. If x has the same methods as y, it already is y.</p><h3>Disadvantages of the dependency inversion</h3><p>Implementing the same methods from another struct in an interface can be complicated if those methods are either too complex to implement or not worth the effort. In such cases, other solutions might be more suitable for resolving the problem.</p><h3>Dependency Injection</h3><p>In this mode, the idea is to use a different approach than importing: function arguments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4BwpWo2hQB17JXQRWdcG7A.png" /></figure><p>In this example, the function from package 2 is no longer imported for use in package 1, which would cause an import cycle. Instead, package 2 imports the method that would use its function from package 1. After doing so, package 2 injects its function as a parameter to the method and distributes it to the rest of the code, thus resulting in dependency injection. This flow can occur in other ways and directions within the code, but the idea of ​​dependency injection remains the same.</p><h3>Disadvantage of the Dependency Injection</h3><p>This solution may often seem confusing, messy, and even a bit over-engineered, but it is still one of the solutions to solve the import cycle problem.</p><h3>Fusion</h3><p>This method is the simplest and fastest of all, being the solution I found and considered best for the import cycle issue I was facing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jPtQaWzl4acKydFHJ4z_cw.png" /></figure><p>Think of this solution as if Go were telling you: “Hey, don’t you think you’re overdoing the modularization? How about merging these packages?”. This approach is usually the best when the import cycle warning occurs in extremely small projects (as is the case with mine), and you intend to maintain code integrity. Here, you just need to merge the two conflicting packages, and perhaps refactor some names to maintain code readability and maintainability.Desvantagens da fusão</p><p>If implemented in the wrong modules, it can create coupling in the code and end up becoming a problem for your future self! Be careful with this method.</p><h3>Conclusion</h3><p>The “import cycle not allowed” error shouldn’t be seen as an obstacle, but as a feedback mechanism from the compiler about the health of your software design. When Go prevents us from proceeding with a cycle, it forces us to stop and ask: “Are these two things really distinct or should they be one?” or “Who should really be in charge here?”.</p><p>Solving an import cycle almost always results in more testable, decoupled, and easier-to-understand code. Whether through dependency inversion, injection, or simply merging packages, the ultimate goal is the same: to keep the flow of dependencies clear and unidirectional. The next time the compiler complains, thank it; it’s preventing you from creating a “knot” that would be much harder to untie in the future.</p><p>These are just some of the solutions that exist for this problem. I hope you enjoyed the ones I showed here, thank you!</p><h3>References</h3><p>Fixing import cycle in Go. Question. Stack Overflow, July 20, 2018. Available at: &lt;<a href="https://stackoverflow.com/questions/50986022/fixing-import-cycle-in-go">https://stackoverflow.com/questions/50986022/fixing-import-cycle-in-go</a>&gt;. Accessed January 20, 2026.</p><p>Directed acyclic graph. In: WIKIPEDIA, the free encyclopedia. [St. l.]: Wikimedia Foundation, 2023. Available at: &lt;<a href="https://en.wikipedia.org/wiki/Directed_acyclic_graph">https://en.wikipedia.org/wiki/Directed_acyclic_graph</a>&gt;. Accessed January 20, 2026.</p><p>ATWOOD, Jeff. The Big Ball of Mud and Other Architectural Disasters. Coding Horror, October 26, 2007. Available at: &lt;<a href="https://blog.codinghorror.com/the-big-ball-of-mud-and-other-architectural-disasters/">https://blog.codinghorror.com/the-big-ball-of-mud-and-other-architectural-disasters/</a>&gt;. Accessed on: January 20, 2026.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f2fb3457685b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Reduced Friction in My Studies Using AI, Rust, and Obsidian.]]></title>
            <link>https://gabrieldevel.medium.com/how-i-reduced-friction-in-my-studies-using-ai-rust-and-obsidian-f260eed60b0b?source=rss-23f8f30948bf------2</link>
            <guid isPermaLink="false">https://medium.com/p/f260eed60b0b</guid>
            <category><![CDATA[obsidian]]></category>
            <category><![CDATA[notes]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[rust]]></category>
            <dc:creator><![CDATA[Gabriel Santos]]></dc:creator>
            <pubDate>Fri, 09 Jan 2026 22:05:46 GMT</pubDate>
            <atom:updated>2026-01-09T22:05:46.771Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Fjkc9yWDQ-5XrUm0jbRZw.png" /><figcaption>Image created with AI</figcaption></figure><p>Every student knows: note-taking is fundamental for retention, but the act of formatting notes often consumes more energy than the learning itself. I found myself stuck in a cycle where research flowed smoothly, but documentation in Obsidian was a manual bottleneck.</p><p>Initially, I researched, practiced, and took notes manually. I tried using AI to generate summaries, but the “Copy from Chat -&gt; Open Obsidian -&gt; Create File -&gt; Paste” process was still too slow. When I had 10 topics to study, I ended up giving up on the notes halfway through.</p><p>With that, I had the idea to further automate the note-taking process. I decided to create an application that does this automatically, and all I need to do for it to work is give it the name of the subject I want to summarize. Thus, noteap was born.</p><h3>The Solution: The Noteap Ecosystem</h3><p>To automate this, I divided the problem into three layers:</p><ul><li><strong>The Interface (React Native):</strong> A simple app where I just type the topic (e.g., “Rust Ownership”). No distractions.</li><li><strong>The Brain (Node.js + Gemini AI):</strong> A server that receives the topic, uses prompt engineering to generate a structured Markdown with code examples, and saves everything in a MongoDB database.</li><li><strong>The Synchronizer (Rust)</strong>: Here’s the key difference. I developed a Rust client that runs on my desktop. It retrieves pending notes from the server, converts them into .md files, and injects them directly into my “New Notes” folder in Obsidian.</li></ul><h4>Why Rust in the Client?</h4><p>I chose Rust for its performance and the ease of generating a single binary. It starts with the system, consumes irrelevant resources, and ensures that when I open my computer to review, my notes from the previous session are already there, waiting for me. Why not choose C, C++, or Go? Both generate a single binary and are good languages, and the answer lies in the cost-complexity-performance ratio. Of these languages, I believe Rust is the one that maintains the most user-friendly syntax despite being low-level, and with good performance, which is why it was chosen.</p><h3>Deployment</h3><p>To keep the server always online, I put it running inside a Docker container on my AWS EC2 server, so I just need to grab the URL to use it with the other applications in the project.</p><h3>Beyond Cognitive Load</h3><p>According to Annie Piolat, in her study “Cognitive effort during note taking,” note-taking is one of the most demanding mental tasks, consuming immense cognitive effort. Often, the act of formatting notes and organizing files consumes more energy than the learning itself, creating what I call “documentation friction.”</p><p>By automating this workflow, I’m not just “saving time,” I’m preserving my mental energy.</p><p>Automation has given me back the time I used to spend on formatting, allowing me to apply the effort that Piolat describes to active review and practical application, and not to the bureaucracy of paper (or the .md file).</p><p>And you? How do you manage your time and your notes? Have you ever tried to automate this process?</p><h3>References</h3><p><strong>PIOLAT, A.; OLIVE, T.; KELLOGG, R. T.</strong> Cognitive effort during note taking. Applied Cognitive Psychology, 2005. (Base article on mental effort in note taking).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f260eed60b0b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>