<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Possawat Sanorkam</title>
    <description>The latest articles on Forem by Possawat Sanorkam (@parmcoder).</description>
    <link>https://forem.com/parmcoder</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F891489%2F90ce5374-9aa0-4b30-90cd-8797ed1dce71.jpeg</url>
      <title>Forem: Possawat Sanorkam</title>
      <link>https://forem.com/parmcoder</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/parmcoder"/>
    <language>en</language>
    <item>
      <title>Microservices are Technical Debt</title>
      <dc:creator>Possawat Sanorkam</dc:creator>
      <pubDate>Sun, 22 Sep 2024 16:55:15 +0000</pubDate>
      <link>https://forem.com/parmcoder/microservices-are-technical-debt-eh2</link>
      <guid>https://forem.com/parmcoder/microservices-are-technical-debt-eh2</guid>
      <description>&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=LcJKxPXYudE&amp;amp;t=103s" rel="noopener noreferrer"&gt;The video&lt;/a&gt; is a discussion about microservices trade-offs and I just generated a summary with AI.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;Microservices can create technical debt, leading to distributed monoliths. It’s crucial to balance speed and architecture in software development.&lt;/p&gt;

&lt;h2&gt;
  
  
  Highlights
&lt;/h2&gt;

&lt;p&gt;🚀 Microservices vs. Monoliths: Transitioning from a monolithic architecture to microservices can enhance team agility.&lt;br&gt;
🔄 Independent Deployments: Microservices allow for independent deployment, reducing conflicts among teams.&lt;br&gt;
⚖️ Scaling Challenges: As teams grow, scaling a monolith can become problematic, prompting the need for microservices.&lt;br&gt;
💡 Technical Debt: Microservices can initially speed up development but may lead to long-term maintenance challenges.&lt;br&gt;
🛠️ Sociotechnical Problems: The interplay between technology and team dynamics complicates microservices adoption.&lt;br&gt;
📊 Quality of Assertions: Test coverage metrics can be misleading; quality assertions matter more than quantity.&lt;br&gt;
🤖 Need for New Frameworks: The industry should develop alternatives to monolith and microservices to better suit evolving software needs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Insights
&lt;/h2&gt;

&lt;p&gt;🔍 Understanding Microservices: While microservices can improve speed, they often introduce complexities that require careful management. Teams must ensure they’re not just replicating existing monolith issues in a distributed form.&lt;br&gt;
🛡️ Technical Debt Awareness: Acknowledging that microservices are, in part, technical debt helps teams prioritize long-term sustainability alongside immediate needs.&lt;br&gt;
🔗 Interdependencies: As microservices proliferate, managing interdependencies becomes critical. Teams should strive for a balance between independence and necessary communication.&lt;br&gt;
🧠 Philosophy in Development: Developers often adhere to dogmatic principles that may not suit their specific context. Flexibility and a focus on practical solutions are essential.&lt;br&gt;
⚙️ Tooling Matters: Effective tools can mitigate the challenges of microservices; companies should invest in developing or adopting tools that simplify error tracing and performance monitoring.&lt;br&gt;
🎯 Focus on User Needs: Ultimately, software should serve user needs effectively, regardless of the underlying architecture. Prioritizing user experience over technical perfection is vital.&lt;br&gt;
🏗️ Future of Software Architecture: The industry should explore new frameworks that bridge the gap between monoliths and microservices, fostering more efficient development practices.&lt;/p&gt;

</description>
      <category>abotwrotethis</category>
      <category>webdev</category>
      <category>microservices</category>
    </item>
    <item>
      <title>Code and Chill Guide 2023</title>
      <dc:creator>Possawat Sanorkam</dc:creator>
      <pubDate>Sat, 22 Jul 2023 09:50:21 +0000</pubDate>
      <link>https://forem.com/parmcoder/code-and-chill-guide-2023-aek</link>
      <guid>https://forem.com/parmcoder/code-and-chill-guide-2023-aek</guid>
      <description>&lt;p&gt;Banner from  &lt;a href="https://unsplash.com/@lindahnguyen?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Linda Nguyen&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/pK2G5j7cAyo?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For the sake of productivity and to record my progress of how I use tools to write code and maintain my projects. These are the steps or checklist for me to follow every time I got a new laptop.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://www.tworivercomputer.com/two-monitors-increase-productivity/" rel="noopener noreferrer"&gt;Buy more monitors&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Definitely, you should have at least 2 monitors. Switching between code and docs and other communication tools (ms team, LINE, etc.) would be too frustrating believe me.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://www.freecodecamp.org/news/how-to-configure-your-macos-terminal-with-zsh-like-a-pro-c0ab3f3c1156/" rel="noopener noreferrer"&gt;Set up the terminal&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgrxwkt45juxnk2m6mofi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgrxwkt45juxnk2m6mofi.png" alt="Oh-my-zsh" width="800" height="94"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For me, I think the new Macbook Air will always be my first suggestion for the laptop to buy. It is productive to use most of the time.&lt;/p&gt;

&lt;p&gt;With a good terminal, you can work 2-4 times faster. This will save time and reduced your errors. You can also use &lt;a href="https://github.com/nvbn/thefuck" rel="noopener noreferrer"&gt;fuck&lt;/a&gt; (just like how you swear most of the time) to correct errors easily.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://outstaffyourteam.com/articles/most-popular-ides-for-developers" rel="noopener noreferrer"&gt;Use the tools that suits you&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fal32hsayxd0hxasvsx6y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fal32hsayxd0hxasvsx6y.png" alt="Vscode" width="800" height="131"&gt;&lt;/a&gt;&lt;br&gt;
Personally, it is great to code with VScode with extensions installed. You can actually use &lt;a href="https://dev.to/parmcoder/how-to-manage-vscode-extensions-2kg7"&gt;profiles with VScode&lt;/a&gt; to help you personalize your style.&lt;/p&gt;

&lt;p&gt;However, the project indexing in Python is quite disappointing. I prefer using PyCharm from JetBrains for most stuff related to python.&lt;/p&gt;

&lt;p&gt;In case you have high wpm typing speed, you can try &lt;a href="https://www.youtube.com/watch?v=ajmK0ZNcM4Q" rel="noopener noreferrer"&gt;neovim&lt;/a&gt;. This will take practices and once you are comfortable with this. You can work 2-3 times faster than average IDE users. It will rely on both typing speed and accuracy also to maximize the potential.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://blog.google/products/chrome/manage-tabs-with-google-chrome/" rel="noopener noreferrer"&gt;Manage your browser tabs&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9os3t8x54gskugipoxnm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9os3t8x54gskugipoxnm.png" alt="Browser tabs" width="800" height="46"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Recently, Apple announced &lt;a href="https://www.youtube.com/watch?v=PYjqYeKeUPo" rel="noopener noreferrer"&gt;the new features&lt;/a&gt; for the upcoming macOS. Well, it is also available in Google Chrome already. You can try to use it also. For me, I use it to group tabs from Github, Gitlab, and my jira projects.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://jedfoundation.org/resource/how-music-can-improve-your-mental-health/" rel="noopener noreferrer"&gt;Listen to music&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdrxlwu15djiraqgl6sm6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdrxlwu15djiraqgl6sm6.png" alt="Space" width="800" height="137"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Get a playlist of your taste and listen to them while you code. It does not make you work faster, but it is good for your mental health and it is fun!&lt;/p&gt;

&lt;p&gt;To stay focus, try &lt;a href="https://www.youtube.com/watch?v=fWLznPU0TTw" rel="noopener noreferrer"&gt;white noise&lt;/a&gt; and set the volume to where you feel relaxed.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://www.cnbc.com/2023/01/06/how-slowing-down-at-work-can-help-you-get-more-done.html" rel="noopener noreferrer"&gt;Rest&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Yup, just rest. Maintaining your work-life balance is the chill part. Eventually, you will spend less time than most people on average and still get your job done.&lt;/p&gt;

&lt;p&gt;Please follow me, bookmark this, give this a like and share it to those who are not chilled or not coding. Thank you guys!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>programming</category>
      <category>productivity</category>
      <category>tooling</category>
    </item>
    <item>
      <title>How to manage VSCode extensions?</title>
      <dc:creator>Possawat Sanorkam</dc:creator>
      <pubDate>Thu, 09 Mar 2023 07:59:13 +0000</pubDate>
      <link>https://forem.com/parmcoder/how-to-manage-vscode-extensions-2kg7</link>
      <guid>https://forem.com/parmcoder/how-to-manage-vscode-extensions-2kg7</guid>
      <description>&lt;p&gt;The new update from VSCode is Profiles system.&lt;/p&gt;

&lt;p&gt;From the &lt;a href="https://code.visualstudio.com/docs/editor/profiles" rel="noopener noreferrer"&gt;doc&lt;/a&gt;, you can see that you can share your profiles by exporting it.&lt;/p&gt;

&lt;p&gt;That means, we can quickly set up the VSCode for any dev from a gist or file.&lt;/p&gt;

&lt;p&gt;So, every collaborator will share the same environment and you can work together with the same tools. Possibly, you can add more extensions on your behalf and keep working also.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6ww2npagal0zfrzlrlq1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6ww2npagal0zfrzlrlq1.png" alt=" " width="617" height="368"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>vscode</category>
      <category>productivity</category>
      <category>news</category>
    </item>
    <item>
      <title>Generating TypeScript APIs with OpenAPI Generator and Keeping Attribute Names Unchanged</title>
      <dc:creator>Possawat Sanorkam</dc:creator>
      <pubDate>Thu, 12 Jan 2023 14:56:29 +0000</pubDate>
      <link>https://forem.com/parmcoder/generating-typescript-apis-with-openapi-generator-and-keeping-attribute-names-unchanged-4bc2</link>
      <guid>https://forem.com/parmcoder/generating-typescript-apis-with-openapi-generator-and-keeping-attribute-names-unchanged-4bc2</guid>
      <description>&lt;p&gt;To generate the API in TypeScript with the attribute name's first letter not capitalized, you can use the --model-name-prefix option in the openapi-generator-cli command. This will allow you to specify a prefix that will be added to the beginning of all generated model names. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;openapi-generator-cli generate &lt;span class="nt"&gt;-i&lt;/span&gt; /path/to/spec.yaml &lt;span class="nt"&gt;-g&lt;/span&gt; typescript-fetch &lt;span class="nt"&gt;-o&lt;/span&gt; /output/directory &lt;span class="nt"&gt;--model-name-prefix&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;''&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will generate the TypeScript API in the specified output directory, and the attribute names in the generated models will have the first letter not capitalized.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>tooling</category>
      <category>abotwrotethis</category>
    </item>
    <item>
      <title>Effective End-to-End Testing: A Beginner's Guide to Playwright</title>
      <dc:creator>Possawat Sanorkam</dc:creator>
      <pubDate>Wed, 11 Jan 2023 08:46:47 +0000</pubDate>
      <link>https://forem.com/parmcoder/effective-end-to-end-testing-a-beginners-guide-to-playwright-bc4</link>
      <guid>https://forem.com/parmcoder/effective-end-to-end-testing-a-beginners-guide-to-playwright-bc4</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;We can ensure the reliability and functionality of a deployed service using &lt;strong&gt;health check and smoke tests&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Health Check
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Health check&lt;/strong&gt; is used to verify that all endpoints of a deployed service are accessible and return the expected status code of 200 (OK). &lt;/p&gt;

&lt;p&gt;To implement health check tests using Playwright, you can create a script that sends requests to each endpoint of your service and asserts that the response has a status code of 200.&lt;/p&gt;

&lt;h3&gt;
  
  
  Smoke test
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Smoke tests&lt;/strong&gt;, on the other hand, cover all endpoints as well &lt;strong&gt;but with more extensive assertions&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Fun fact: In plumbling, &lt;a href="https://www.wyman-services.com/plumbing-problems/what-is-smoke-testing/" rel="noopener noreferrer"&gt;smoke testing&lt;/a&gt; is just another tool used to find leaks or sources of odor in pipes and sewage systems. It is not actually smoke, but the same type substance that comes out of fog machines. It is used to detect sewer gas leaks caused by broken pipes, bad connections, venting issues, open pipes or fittings&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To implement smoke tests using Playwright, you can create a script that sends requests to each endpoint of your service and asserts that the response has the expected status code, body and error message&lt;/p&gt;

&lt;h2&gt;
  
  
  Health check example
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;playwright&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;playwright&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Start a browser&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;browser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;playwright&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;chromium&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;launch&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="c1"&gt;// Create a new context (page)&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;context&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;browser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;newContext&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="c1"&gt;// Create a new page&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;newPage&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="c1"&gt;// Define the endpoint URLs that you want to test&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;endpoints&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://example.com/api/users&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://example.com/api/orders&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://example.com/api/products&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;];&lt;/span&gt;

    &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;endpoint&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;endpoints&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// Send a GET request to each endpoint&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;goto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;endpoint&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="c1"&gt;// Assert that the status code is 200&lt;/span&gt;
        &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;endpoint&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;endpoints&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// Send a GET request to each endpoint&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;goto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;endpoint&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="c1"&gt;// Assert that the status code is 200&lt;/span&gt;
        &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c1"&gt;// Close the browser&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;browser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;close&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;})();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Smoke test example
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;playwright&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;playwright&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;assert&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;assert&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Start a browser&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;browser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;playwright&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;chromium&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;launch&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="c1"&gt;// Create a new context (page)&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;context&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;browser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;newContext&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="c1"&gt;// Create a new page&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;newPage&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="c1"&gt;// Define the endpoint URLs that you want to test&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;endpoints&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://example.com/api/users&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;expectedStatusCode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;expectedBody&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;user1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://example.com/api/orders&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;expectedStatusCode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;expectedBody&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;order1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://example.com/api/products&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;expectedStatusCode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;404&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;expectedBody&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;product not found&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;];&lt;/span&gt;

    &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;endpoint&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;endpoints&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// Send a GET request to each endpoint&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;goto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;endpoint&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="c1"&gt;// Assert that the status code is as expected&lt;/span&gt;
        &lt;span class="nx"&gt;assert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strictEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="nx"&gt;endpoint&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;expectedStatusCode&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="c1"&gt;// Assert that the response body is as expected&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;responseBody&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;evaluate&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;textContent&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
        &lt;span class="nx"&gt;assert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;deepEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;responseBody&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;endpoint&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;expectedBody&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c1"&gt;// Close the browser&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;browser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;close&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;})();&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Surprise! This article is written by ChatGPT!&lt;/p&gt;

</description>
      <category>gratitude</category>
    </item>
    <item>
      <title>What diagram should I know as a software engineer? Part 2</title>
      <dc:creator>Possawat Sanorkam</dc:creator>
      <pubDate>Tue, 03 Jan 2023 07:42:33 +0000</pubDate>
      <link>https://forem.com/parmcoder/what-diagram-should-i-know-as-a-software-engineer-part-2-2c7g</link>
      <guid>https://forem.com/parmcoder/what-diagram-should-i-know-as-a-software-engineer-part-2-2c7g</guid>
      <description>&lt;p&gt;Here are a few types of diagrams that are commonly used in &lt;strong&gt;software development management&lt;/strong&gt;:&lt;/p&gt;

&lt;h2&gt;
  
  
  Gantt charts
&lt;/h2&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://www.investopedia.com/terms/g/gantt-chart.asp" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.investopedia.com%2Fthmb%2F9mwRRmGCFy5eLhVju3HNgiI5fYw%3D%2F1500x0%2Ffilters%3Ano_upscale%28%29%3Amax_bytes%28150000%29%3Astrip_icc%28%29%2Fgantt-chart.asp-Final-9dc0992ed31545d382ff46f495afa0c5.png" height="540" class="m-0" width="800"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://www.investopedia.com/terms/g/gantt-chart.asp" rel="noopener noreferrer" class="c-link"&gt;
            Gantt Chart: Definition, Benefits, and How It’s Used
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            A Gantt chart is a visual representation of a project schedule, showing the start and finish date of several elements of a project.
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.investopedia.com%2Ffavicon.ico" width="48" height="48"&gt;
          investopedia.com
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Gantt charts are used to visually represent the timeline and dependencies of tasks in a project. They can be used to track progress, identify bottlenecks, and plan resources.&lt;/p&gt;

&lt;h2&gt;
  
  
  Kanban boards
&lt;/h2&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://businessmap.io/kanban-resources/getting-started/what-is-kanban-board" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fbusinessmap.io%2Fwp-content%2Fuploads%2Fwebsite-images%2Fkanban-resources%2Fkanban-board-top-agile-planning-delivery-tool.png" height="466" class="m-0" width="800"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://businessmap.io/kanban-resources/getting-started/what-is-kanban-board" rel="noopener noreferrer" class="c-link"&gt;
            What Is a Kanban Board? A Comprehensive Guide
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            Uncover the power of Kanban boards to visualize, manage, and optimize your workflow. This comprehensive guide will empower you to create effective Kanban boards, track progress, and achieve peak productivity.
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fbusinessmap.io%2Fimages%2Ffavicon.ico" width="64" height="64"&gt;
          businessmap.io
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Kanban boards are used to visualize the workflow of a project and the status of tasks. They can be used to track the movement of tasks through different stages of development and to identify bottlenecks in the process.&lt;/p&gt;

&lt;h2&gt;
  
  
  Project roadmap
&lt;/h2&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://toggl.com/blog/what-is-a-project-roadmap" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Ftoggl.com%2Fblog%2Fwp-content%2Fuploads%2F2018%2F08%2Fproject-roadmap-guide.png" height="479" class="m-0" width="800"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://toggl.com/blog/what-is-a-project-roadmap" rel="noopener noreferrer" class="c-link"&gt;
            Project Roadmap: What Is It &amp;amp; How To Create One To Manage Stakeholder Expectations?
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            A project roadmap is a high-level, visual overview of a project that helps kick off a project and manage stakeholder expectations. Learn how to create one.
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Ftoggl.com%2Fblog%2Fwp-content%2Fthemes%2Ftoggl-mjtweaver%2Fimg%2Ffavicon%2Ffavicon.svg" width="256" height="256"&gt;
          toggl.com
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;A project roadmap is a high-level visual representation of the goals, milestones, and deliverables of a project. It can be used to communicate the overall direction and progress of a project to stakeholders.&lt;/p&gt;

&lt;h2&gt;
  
  
  Swimlane diagrams
&lt;/h2&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
      &lt;div class="c-embed__body flex items-center justify-between"&gt;
        &lt;a href="https://www.mindmanager.com/en/features/swim-lane-diagram/" rel="noopener noreferrer" class="c-link fw-bold flex items-center"&gt;
          &lt;span class="mr-2"&gt;mindmanager.com&lt;/span&gt;
          

        &lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Swimlane diagrams show the flow of tasks or activities within a project, often used to model the workflow of a project and to identify bottlenecks or inefficiencies.&lt;/p&gt;

&lt;h2&gt;
  
  
  Value stream maps
&lt;/h2&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/cDfH0U4Nw-I"&gt;
&lt;/iframe&gt;
 &lt;/p&gt;

&lt;p&gt;Value stream maps show the flow of value through a process, often used to identify and eliminate waste in a process and to improve efficiency.&lt;/p&gt;

&lt;p&gt;Surprise! This article is written by ChatGPT! I added some useful links to further read more about these diagrams.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>devops</category>
      <category>abotwrotethis</category>
    </item>
    <item>
      <title>Optimizing Go code with GCCGO for improved performance</title>
      <dc:creator>Possawat Sanorkam</dc:creator>
      <pubDate>Thu, 29 Dec 2022 16:24:22 +0000</pubDate>
      <link>https://forem.com/parmcoder/optimizing-go-code-with-gccgo-for-improved-performance-2d3d</link>
      <guid>https://forem.com/parmcoder/optimizing-go-code-with-gccgo-for-improved-performance-2d3d</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;One day, my teacher asked me why Go compiled program has terrible perfomance and he kept mentioning about how a good compiler should behave.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Tldr; Check out &lt;a href="https://github.com/parmcoder/go-beast-mode" rel="noopener noreferrer"&gt;my demo!&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is using &lt;code&gt;gccgo -O3 -o cool main.go&lt;/code&gt; instead of &lt;code&gt;go build main.go&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Basically, you will find that some code could run faster by changing the compiler instead of rewriting the code.&lt;/p&gt;

&lt;p&gt;So, we want to turn our code into its peak performance despite getting bugs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuv5icp4n861xz5vr0sne.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuv5icp4n861xz5vr0sne.gif" alt="Super gopher" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Consider the following code...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s"&gt;"errors"&lt;/span&gt;
    &lt;span class="s"&gt;"fmt"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="n"&gt;limA&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;2000&lt;/span&gt;

&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;EulerSolution&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;first&lt;/span&gt;   &lt;span class="kt"&gt;int&lt;/span&gt;
    &lt;span class="n"&gt;second&lt;/span&gt;  &lt;span class="kt"&gt;int&lt;/span&gt;
    &lt;span class="n"&gt;third&lt;/span&gt;   &lt;span class="kt"&gt;int&lt;/span&gt;
    &lt;span class="n"&gt;fourth&lt;/span&gt;  &lt;span class="kt"&gt;int&lt;/span&gt;
    &lt;span class="n"&gt;culprit&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;intPow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;*=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;computeEuler&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;EulerSolution&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;limA&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;a5&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;intPow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;b5&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;intPow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;c5&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;intPow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                        &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;d5&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;intPow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                        &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;e5&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;intPow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                        &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;got&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a5&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b5&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;c5&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;d5&lt;/span&gt;

                        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;got&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;e5&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;EulerSolution&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
                                &lt;span class="n"&gt;first&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;   &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                                &lt;span class="n"&gt;second&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;  &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                                &lt;span class="n"&gt;third&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;   &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                                &lt;span class="n"&gt;fourth&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;  &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                                &lt;span class="n"&gt;culprit&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                            &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt;
                        &lt;span class="p"&gt;}&lt;/span&gt;

                    &lt;span class="p"&gt;}&lt;/span&gt;
                &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;EulerSolution&lt;/span&gt;&lt;span class="p"&gt;{},&lt;/span&gt; &lt;span class="n"&gt;errors&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;New&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Euler solution"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We know that this code is poorly written. Let's write the another function that produce similar result.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;computeBeastEuler&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;EulerSolution&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;limA&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;e5&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;intPow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;a5&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;intPow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;b5&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;intPow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;c5&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;intPow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                        &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;d5&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;intPow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                        &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;got&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a5&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b5&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;c5&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;d5&lt;/span&gt;
                        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;got&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;e5&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;EulerSolution&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
                                &lt;span class="n"&gt;first&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;   &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                                &lt;span class="n"&gt;second&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;  &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                                &lt;span class="n"&gt;third&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;   &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                                &lt;span class="n"&gt;fourth&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;  &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                                &lt;span class="n"&gt;culprit&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                            &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt;
                        &lt;span class="p"&gt;}&lt;/span&gt;

                    &lt;span class="p"&gt;}&lt;/span&gt;
                &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;EulerSolution&lt;/span&gt;&lt;span class="p"&gt;{},&lt;/span&gt; &lt;span class="n"&gt;errors&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;New&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Euler solution"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Much better, now we want to prove that the new function, &lt;code&gt;computeBeastEuler&lt;/code&gt;, is faster.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;go &lt;span class="nb"&gt;test&lt;/span&gt; &lt;span class="nt"&gt;-bench&lt;/span&gt; main_test.go &lt;span class="nt"&gt;-v&lt;/span&gt;

&lt;span class="o"&gt;===&lt;/span&gt; RUN   Test_computeEuler
&lt;span class="o"&gt;===&lt;/span&gt; RUN   Test_computeEuler/empty
&lt;span class="nt"&gt;---&lt;/span&gt; PASS: Test_computeEuler &lt;span class="o"&gt;(&lt;/span&gt;4.19s&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="nt"&gt;---&lt;/span&gt; PASS: Test_computeEuler/empty &lt;span class="o"&gt;(&lt;/span&gt;4.19s&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;===&lt;/span&gt; RUN   Test_computeBeastEuler
&lt;span class="o"&gt;===&lt;/span&gt; RUN   Test_computeBeastEuler/empty
&lt;span class="nt"&gt;---&lt;/span&gt; PASS: Test_computeBeastEuler &lt;span class="o"&gt;(&lt;/span&gt;2.51s&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="nt"&gt;---&lt;/span&gt; PASS: Test_computeBeastEuler/empty &lt;span class="o"&gt;(&lt;/span&gt;2.51s&lt;span class="o"&gt;)&lt;/span&gt;
PASS
ok      go-beast-demo   6.705s
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is better, and we expect our &lt;code&gt;go build&lt;/code&gt; to do the optimization for us.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;go build main.go
&lt;span class="nb"&gt;time&lt;/span&gt; ./main 
&lt;span class="o"&gt;{&lt;/span&gt;133 110 84 27 144&lt;span class="o"&gt;}&lt;/span&gt;

real    0m4.371s
...

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Well, it is not what we expected. The problem is that Go compiler is not focusing on optimization by default. It only focuses on compilation speed.&lt;/p&gt;

&lt;p&gt;Now, let me talk about another compiler that will help us get the faster program using the same code.&lt;/p&gt;

&lt;p&gt;Let's install &lt;code&gt;gccgo&lt;/code&gt; to our machine. &lt;a href="https://github.com/golang/go/issues/463" rel="noopener noreferrer"&gt;Make sure that you are not using Darwin OS!&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone &lt;span class="nt"&gt;--branch&lt;/span&gt; devel/gccgo git://gcc.gnu.org/git/gcc.git gccgo
&lt;span class="nb"&gt;mkdir &lt;/span&gt;objdir
&lt;span class="nb"&gt;cd &lt;/span&gt;objdir
../gccgo/configure &lt;span class="nt"&gt;--prefix&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/opt/gccgo &lt;span class="nt"&gt;--enable-languages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;c,c++,go &lt;span class="nt"&gt;--with-ld&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/opt/gold/bin/ld
make
make &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;References:&lt;br&gt;
&lt;a href="https://go.dev/doc/install/gccgo" rel="noopener noreferrer"&gt;gccgo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Anyway, you might run into some problems with its prerequisites for the compiler.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;gccgo
./contrib/download_prerequisites
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The script will download all you need for the &lt;code&gt;gccgo&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Instead, we can just use a dockerfile to help us set up the environment for our new compiler.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="c"&gt;# Download base image ubuntu 20.04&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="s"&gt; ubuntu:20.04&lt;/span&gt;

&lt;span class="c"&gt;# Disable Prompt During Packages Installation&lt;/span&gt;
&lt;span class="k"&gt;ARG&lt;/span&gt;&lt;span class="s"&gt; DEBIAN_FRONTEND=noninteractive&lt;/span&gt;

&lt;span class="c"&gt;# Update Ubuntu Software repository&lt;/span&gt;
&lt;span class="k"&gt;RUN &lt;/span&gt;apt update

&lt;span class="k"&gt;RUN &lt;/span&gt;apt-get update &lt;span class="nt"&gt;-y&lt;/span&gt;

&lt;span class="k"&gt;RUN &lt;/span&gt;apt-get &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; gccgo

&lt;span class="k"&gt;WORKDIR&lt;/span&gt;&lt;span class="s"&gt; /go/app&lt;/span&gt;

&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; . .&lt;/span&gt;

&lt;span class="k"&gt;RUN &lt;/span&gt;gccgo &lt;span class="nt"&gt;-O3&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; cool main.go

&lt;span class="k"&gt;CMD&lt;/span&gt;&lt;span class="s"&gt; ["./cool"]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;References:&lt;br&gt;
&lt;a href="https://www.rapidtables.com/code/linux/gcc/gcc-o.html" rel="noopener noreferrer"&gt;gcc optimize&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Inside the container, let's do the benchmarking again!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker compose build
docker run &lt;span class="nt"&gt;-it&lt;/span&gt; go-beast-mode_app bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inside my container, here is what I got.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;time&lt;/span&gt; ./cool
&lt;span class="o"&gt;{&lt;/span&gt;133 110 84 27 144&lt;span class="o"&gt;}&lt;/span&gt;

real    0m0.906s
user    0m0.583s
sys     0m0.028s
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is even 2x faster than our &lt;code&gt;computeBeastEuler&lt;/code&gt; in time.&lt;/p&gt;

&lt;p&gt;In fact, Go can compile blazingly fast, but the trade-off is the lost of performance. If we want to optimize our Go program, then this is an example of what you could try. It will be compiled slower, but the performance is greatly increased along with the slight increase in memory usage.&lt;/p&gt;

</description>
      <category>go</category>
      <category>programming</category>
    </item>
    <item>
      <title>What diagram should I know as a software engineer?</title>
      <dc:creator>Possawat Sanorkam</dc:creator>
      <pubDate>Wed, 28 Dec 2022 18:10:04 +0000</pubDate>
      <link>https://forem.com/parmcoder/what-diagram-should-i-know-as-a-software-engineer-oem</link>
      <guid>https://forem.com/parmcoder/what-diagram-should-i-know-as-a-software-engineer-oem</guid>
      <description>&lt;h2&gt;
  
  
  Prerequisite
&lt;/h2&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/WnMQ8HlmeXc?start=1063"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;As a software engineer, &lt;strong&gt;it's important to be familiar with a variety of diagrams and notations that are used to design, model, and document software systems&lt;/strong&gt;. Some common types of diagrams that you may encounter include:&lt;/p&gt;

&lt;h2&gt;
  
  
  Class diagrams
&lt;/h2&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/jfeliu007" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F192756%2F8089629e-0c05-45c0-b408-3edc88ea6872.jpeg" alt="jfeliu007"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/jfeliu007/how-to-turn-your-golang-programs-into-uml-class-diagrams-1e5o" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;How to turn your golang programs into UML Class diagrams&lt;/h2&gt;
      &lt;h3&gt;jfeliu007 ・ Jul 9 '19&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#go&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#uml&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;Class diagrams are used to model the static structure of a system, showing the relationships between classes, interfaces, and other objects.&lt;/p&gt;

&lt;h2&gt;
  
  
  Component diagrams
&lt;/h2&gt;

&lt;p&gt;Component diagrams show the relationships between the components of a system, often used to model the structure of a software system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Object diagrams
&lt;/h2&gt;

&lt;p&gt;Object diagrams show the relationships between objects in a system, often used to model the static structure of a system at a specific point in time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Communication diagrams
&lt;/h2&gt;

&lt;p&gt;Communication diagrams show the interactions between objects or components in a system, often used to model the communication between objects in a system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sequence diagrams
&lt;/h2&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/mhmxs" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F671527%2F45f05b55-0c6c-4776-bb21-0c12d3e81410.png" alt="mhmxs"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/mhmxs/sequence-diagrams-are-so-powerful-4i2k" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Sequence diagrams are so powerful&lt;/h2&gt;
      &lt;h3&gt;Richard Kovacs ・ Apr 10 '22&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#design&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#productivity&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#programming&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;Sequence diagrams show the interactions between objects or components in a system, showing the order in which messages are sent and received.&lt;/p&gt;

&lt;h2&gt;
  
  
  State diagrams
&lt;/h2&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://www.geeksforgeeks.org/system-design/unified-modeling-language-uml-state-diagrams/" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.geeksforgeeks.org%2Fwp-content%2Fcdn-uploads%2Fgfg_200x200-min.png" height="200" class="m-0" width="200"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://www.geeksforgeeks.org/system-design/unified-modeling-language-uml-state-diagrams/" rel="noopener noreferrer" class="c-link"&gt;
            State Machine Diagrams | Unified Modeling Language (UML) - GeeksforGeeks
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            Your All-in-One Learning Portal: GeeksforGeeks is a comprehensive educational platform that empowers learners across domains-spanning computer science and programming, school education, upskilling, commerce, software tools, competitive exams, and more.
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.geeksforgeeks.org%2Fwp-content%2Fcdn-uploads%2Fgfg_favicon.png" width="32" height="32"&gt;
          geeksforgeeks.org
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
State diagrams show the possible states of a system and the transitions between those states, often used to model the behavior of a system.
&lt;h2&gt;
  
  
  Activity diagrams
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.smartdraw.com/activity-diagram/" rel="noopener noreferrer"&gt;Activity diagrams&lt;/a&gt; show the flow of activities or actions within a system, often used to model business processes or workflows.&lt;/p&gt;
&lt;h2&gt;
  
  
  Use case diagrams
&lt;/h2&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://www.geeksforgeeks.org/software-engineering/use-case-diagram-for-online-banking-system/" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.geeksforgeeks.org%2Fwp-content%2Fcdn-uploads%2Fgfg_200x200-min.png" height="200" class="m-0" width="200"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://www.geeksforgeeks.org/software-engineering/use-case-diagram-for-online-banking-system/" rel="noopener noreferrer" class="c-link"&gt;
            Use Case Diagram for Online Banking System - GeeksforGeeks
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            Your All-in-One Learning Portal: GeeksforGeeks is a comprehensive educational platform that empowers learners across domains-spanning computer science and programming, school education, upskilling, commerce, software tools, competitive exams, and more.
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.geeksforgeeks.org%2Fwp-content%2Fcdn-uploads%2Fgfg_favicon.png" width="32" height="32"&gt;
          geeksforgeeks.org
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Use case diagrams show the interactions between a system and its users, showing the different ways that a system can be used.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deployment diagrams
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.tutorialspoint.com/uml/uml_deployment_diagram.htm" rel="noopener noreferrer"&gt;Deployment diagrams&lt;/a&gt; show the physical components of a system and how they are deployed on hardware, often used to model the architecture of a distributed system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Data flow diagrams
&lt;/h2&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://www.geeksforgeeks.org/software-engineering/what-is-dfddata-flow-diagram/" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.geeksforgeeks.org%2Fwp-content%2Fcdn-uploads%2Fgfg_200x200-min.png" height="200" class="m-0" width="200"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://www.geeksforgeeks.org/software-engineering/what-is-dfddata-flow-diagram/" rel="noopener noreferrer" class="c-link"&gt;
            What is DFD (Data Flow Diagram) - GeeksforGeeks
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            Your All-in-One Learning Portal: GeeksforGeeks is a comprehensive educational platform that empowers learners across domains-spanning computer science and programming, school education, upskilling, commerce, software tools, competitive exams, and more.
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.geeksforgeeks.org%2Fwp-content%2Fcdn-uploads%2Fgfg_favicon.png" width="32" height="32"&gt;
          geeksforgeeks.org
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Data flow diagrams show the flow of data within a system, showing the input, output, and processing of data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Entity relationship diagrams
&lt;/h2&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://www.geeksforgeeks.org/dbms/introduction-of-er-model/" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.geeksforgeeks.org%2Fwp-content%2Fcdn-uploads%2Fgfg_200x200-min.png" height="200" class="m-0" width="200"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://www.geeksforgeeks.org/dbms/introduction-of-er-model/" rel="noopener noreferrer" class="c-link"&gt;
            Introduction of ER Model - GeeksforGeeks
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            Your All-in-One Learning Portal: GeeksforGeeks is a comprehensive educational platform that empowers learners across domains-spanning computer science and programming, school education, upskilling, commerce, software tools, competitive exams, and more.
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmedia.geeksforgeeks.org%2Fwp-content%2Fcdn-uploads%2Fgfg_favicon.png" width="32" height="32"&gt;
          geeksforgeeks.org
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Entity relationship diagrams show the relationships between entities in a database, used to model the structure of a database.&lt;/p&gt;

&lt;h2&gt;
  
  
  Collaboration diagrams
&lt;/h2&gt;

&lt;p&gt;Collaboration diagrams show the interactions between objects or components in a system, often used to model the dynamic behavior of a system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Network diagrams
&lt;/h2&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
      &lt;div class="c-embed__body flex items-center justify-between"&gt;
        &lt;a href="https://www.smartdraw.com/network-diagram/" rel="noopener noreferrer" class="c-link fw-bold flex items-center"&gt;
          &lt;span class="mr-2"&gt;smartdraw.com&lt;/span&gt;
          

        &lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Network diagrams show the connections between devices on a network, often used to model the topology of a network.&lt;/p&gt;

&lt;h2&gt;
  
  
  Interaction overview diagrams
&lt;/h2&gt;

&lt;p&gt;Interaction overview diagrams show the flow of messages between objects or components in a system, often used to model the overall flow of interactions in a system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Timing diagrams
&lt;/h2&gt;

&lt;p&gt;Timing diagrams show the behavior of a system over time, often used to model the timing and duration of events in a system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Object constraint language (OCL) diagrams
&lt;/h2&gt;

&lt;p&gt;OCL diagrams use a specialized notation to describe constraints on the behavior of a system, often used to specify the behavior of a system in more detail. It is an advanced concept, so here is the &lt;a href="http://st.inf.tu-dresden.de/files/general/OCLByExampleLecture.pdf" rel="noopener noreferrer"&gt;lecture note.&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Graphical user interface (GUI) diagrams
&lt;/h2&gt;

&lt;p&gt;Graphical user interface (GUI) diagrams are visual representations of the user interface (UI) of a software application or system. GUI diagrams show how the UI is organized and how it interacts with the user. These diagrams can be used to design and document the UI of a software application, and they can also be helpful for understanding and navigating an existing UI.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fobmvpoysszf8aa3ca3ly.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fobmvpoysszf8aa3ca3ly.png" alt=" " width="644" height="425"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GUI diagrams typically include elements such as windows, dialog boxes, buttons, menus, and other interactive elements that are used to interact with the software.&lt;/strong&gt; They may also include representations of data and other information that is displayed to the user. GUI diagrams are often created using specialized diagramming tools, and they may be included in software design documents or used as part of the development process.&lt;/p&gt;

&lt;p&gt;Surprise! This article is written by ChatGPT! I added some useful links to further read more about these diagrams.&lt;/p&gt;

</description>
      <category>vue</category>
      <category>jquery</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Using Git to track down deleted code in a large project</title>
      <dc:creator>Possawat Sanorkam</dc:creator>
      <pubDate>Mon, 19 Dec 2022 05:47:20 +0000</pubDate>
      <link>https://forem.com/parmcoder/using-git-to-track-down-deleted-code-in-a-large-project-14j1</link>
      <guid>https://forem.com/parmcoder/using-git-to-track-down-deleted-code-in-a-large-project-14j1</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;My code is now deleted in file A around line 800, and I do not know when it was deleted. How to find the person who deleted my code from git?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;TLDR;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Search from line&lt;/span&gt;
git blame &lt;span class="nt"&gt;-L&lt;/span&gt; 800,800 A

&lt;span class="c"&gt;# Search from text&lt;/span&gt;
git log &lt;span class="nt"&gt;-S&lt;/span&gt; &lt;span class="s2"&gt;"CODE_TO_SEARCH"&lt;/span&gt; A
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To find out who deleted code from a file using git, you can use the &lt;code&gt;git blame&lt;/code&gt; command. This command shows the last commit that modified each line of code in a file, along with the author and date of the commit.&lt;/p&gt;

&lt;p&gt;To see the commit that deleted a specific line of code, you can use the &lt;code&gt;git blame&lt;/code&gt; command with the &lt;code&gt;-L&lt;/code&gt; option, which allows you to specify a range of lines. For example, to see the commit that deleted code around line 800 in file A, you can use the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git blame &lt;span class="nt"&gt;-L&lt;/span&gt; 800,800 A
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will show the commit that modified line 800 in file A, along with the author and date of the commit. &lt;del&gt;If the code was deleted in this commit, it will also show the line of code that was deleted.&lt;/del&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a class="mentioned-user" href="https://dev.to/hrnkas"&gt;@hrnkas&lt;/a&gt; Git does not show deleted lines when using blame. It only shows information for remaining lines, and that is the commit information when those line have last been changed.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can also use the git log command with the &lt;code&gt;-S&lt;/code&gt; option to search the commit history for a specific string of code. This can be helpful if you don't know the exact line number where the code was deleted.&lt;/p&gt;

&lt;p&gt;For example, to search for the commit that deleted a specific string of code from file A, you can use the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git log &lt;span class="nt"&gt;-S&lt;/span&gt; &lt;span class="s2"&gt;"CODE_TO_SEARCH"&lt;/span&gt; A
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;a class="mentioned-user" href="https://dev.to/hrnkas"&gt;@hrnkas&lt;/a&gt; Actually, the exact solution would be &lt;code&gt;git log -S "CODE_TO_SEARCH" -c --cc A&lt;/code&gt;&lt;br&gt;
You also need -c and --cc flags to show commits where search text has been deleted.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Replace &lt;code&gt;CODE_TO_SEARCH&lt;/code&gt; with the string of code you want to search for. This will show a list of commits that include the specified code, along with the commit message and any other information about the commit.&lt;/p&gt;

&lt;p&gt;Surprise, this article was generated by ChatGPT!&lt;/p&gt;

</description>
      <category>softwaredevelopment</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Git Rebase: The Power Tool for Clean Git Histories</title>
      <dc:creator>Possawat Sanorkam</dc:creator>
      <pubDate>Sun, 18 Dec 2022 16:13:50 +0000</pubDate>
      <link>https://forem.com/parmcoder/git-rebase-the-power-tool-for-clean-git-histories-1ofp</link>
      <guid>https://forem.com/parmcoder/git-rebase-the-power-tool-for-clean-git-histories-1ofp</guid>
      <description>&lt;p&gt;Here is an example of using git rebase to incorporate the latest changes from the master branch into a feature branch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;git checkout feature
&lt;span class="c"&gt;# switch to the feature branch&lt;/span&gt;

&lt;span class="nv"&gt;$ &lt;/span&gt;git rebase master
&lt;span class="c"&gt;# apply the commits from the feature branch on top of the latest commits in the master branch&lt;/span&gt;

&lt;span class="c"&gt;# If there are conflicts during the rebase, you will need to resolve them&lt;/span&gt;
&lt;span class="c"&gt;# and then use `git add` to mark the resolved files, and then use&lt;/span&gt;
&lt;span class="c"&gt;# `git rebase --continue` to continue the rebase.&lt;/span&gt;

&lt;span class="nv"&gt;$ &lt;/span&gt;git push &lt;span class="nt"&gt;-f&lt;/span&gt; origin feature
&lt;span class="c"&gt;# push the feature branch to the remote repository, using the -f flag to force the push&lt;/span&gt;
&lt;span class="c"&gt;# (necessary because the commit history of the feature branch has been modified by the rebase)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is an example of using git rebase to "squash" multiple commits into a single commit:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;git checkout feature
&lt;span class="c"&gt;# switch to the feature branch&lt;/span&gt;

&lt;span class="nv"&gt;$ &lt;/span&gt;git rebase &lt;span class="nt"&gt;-i&lt;/span&gt; HEAD~3
&lt;span class="c"&gt;# interactively rebase the last 3 commits&lt;/span&gt;

&lt;span class="c"&gt;# This will open a text editor, showing the list of commits that will be modified by the rebase.&lt;/span&gt;
&lt;span class="c"&gt;# You can use the `squash` command to merge commits together. For example:&lt;/span&gt;
&lt;span class="c"&gt;#&lt;/span&gt;
&lt;span class="c"&gt;# pick abcdefg Some commit message&lt;/span&gt;
&lt;span class="c"&gt;# squash hijklmn Another commit message&lt;/span&gt;
&lt;span class="c"&gt;# squash opqrstu Yet another commit message&lt;/span&gt;

&lt;span class="c"&gt;# Save and close the editor. Git will then apply the changes and open another editor&lt;/span&gt;
&lt;span class="c"&gt;# for you to modify the commit message of the combined commit.&lt;/span&gt;

&lt;span class="nv"&gt;$ &lt;/span&gt;git push &lt;span class="nt"&gt;-f&lt;/span&gt; origin feature
&lt;span class="c"&gt;# push the feature branch to the remote repository, using the -f flag to force the push&lt;/span&gt;
&lt;span class="c"&gt;# (necessary because the commit history of the feature branch has been modified by the rebase)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's important to note that &lt;code&gt;git rebase&lt;/code&gt; should be used with caution, as it modifies the existing commit history of a branch. This can make the commit history more difficult to understand and can cause problems if other people are working on the same branch. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Therefore, it's usually a good idea to use &lt;code&gt;git merge&lt;/code&gt; instead of &lt;code&gt;git rebase&lt;/code&gt; when working with other people.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Surprise, this article was generated by ChatGPT!&lt;/p&gt;

</description>
      <category>git</category>
      <category>beginners</category>
      <category>abotwrotethis</category>
    </item>
    <item>
      <title>What are your New Year's resolutions?</title>
      <dc:creator>Possawat Sanorkam</dc:creator>
      <pubDate>Sun, 18 Dec 2022 08:49:19 +0000</pubDate>
      <link>https://forem.com/parmcoder/what-are-your-new-years-resolutions-3ffg</link>
      <guid>https://forem.com/parmcoder/what-are-your-new-years-resolutions-3ffg</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;I will work towards becoming a senior developer by expanding my skills and knowledge in backend development through continuous learning and practice. I will also focus on building my professional network and seeking out opportunities for professional growth.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It's great to have goals and resolutions for the new year! Here are a few tips for setting and achieving your new year resolutions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Make your resolutions specific and achievable: Instead of resolving to "exercise more," try setting a specific goal such as "exercise for 30 minutes at least three times a week."&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Break your resolution down into smaller goals: If your resolution is a big one, it can be helpful to break it down into smaller, more manageable goals. This will make it easier to track your progress and stay motivated.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a plan: Think about the steps you need to take to achieve your resolution and make a plan to follow. For example, if your resolution is to exercise more, you might plan to join a gym or find an exercise class that you enjoy.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Monitor your progress: Keep track of your progress and celebrate your successes along the way. This will help you stay motivated and on track.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Be flexible: It's okay if you have setbacks or if things don't go exactly as planned. Just stay positive and adjust your plan as needed.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Remember, the key to achieving your new year resolutions is to be patient, persistent, and positive. With hard work and determination, you can achieve your goals!&lt;/p&gt;

&lt;p&gt;Surprise, this article was generated by ChatGPT!&lt;/p&gt;

</description>
      <category>emptystring</category>
    </item>
    <item>
      <title>How to use Apache Kafka in GO using Echo framework?</title>
      <dc:creator>Possawat Sanorkam</dc:creator>
      <pubDate>Thu, 15 Dec 2022 17:56:21 +0000</pubDate>
      <link>https://forem.com/parmcoder/how-to-use-apache-kafka-in-go-using-echo-framework-4a8l</link>
      <guid>https://forem.com/parmcoder/how-to-use-apache-kafka-in-go-using-echo-framework-4a8l</guid>
      <description>&lt;p&gt;To set up Kafka in a Go application using the Echo web framework, you would first need to install the &lt;code&gt;sarama&lt;/code&gt; package, which provides a Go client for Apache Kafka. You can do this using the &lt;code&gt;go get&lt;/code&gt; command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;go&lt;/span&gt; &lt;span class="n"&gt;get&lt;/span&gt; &lt;span class="n"&gt;github&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;Shopify&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;sarama&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the &lt;code&gt;sarama&lt;/code&gt; package is installed, you can use it to connect to Kafka and publish and consume messages. Here is an example of how to set up a Kafka producer in a Go application using the Echo framework and the &lt;code&gt;sarama&lt;/code&gt; package:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s"&gt;"fmt"&lt;/span&gt;
    &lt;span class="s"&gt;"time"&lt;/span&gt;

    &lt;span class="s"&gt;"github.com/Shopify/sarama"&lt;/span&gt;
    &lt;span class="s"&gt;"github.com/labstack/echo"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;kafkaBrokers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;"localhost:9092"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;// Create a new Echo web server&lt;/span&gt;
    &lt;span class="n"&gt;e&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;echo&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;New&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="c"&gt;// Set up a route to handle HTTP POST requests to the /messages endpoint&lt;/span&gt;
    &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;POST&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/messages"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;func&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="n"&gt;echo&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="kt"&gt;error&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c"&gt;// Read the message body from the request&lt;/span&gt;
        &lt;span class="n"&gt;message&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;FormValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="c"&gt;// Create a new Kafka producer&lt;/span&gt;
        &lt;span class="n"&gt;producer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;sarama&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;NewSyncProducer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;kafkaBrokers&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;defer&lt;/span&gt; &lt;span class="n"&gt;producer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Close&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

        &lt;span class="c"&gt;// Publish the message to the "messages" topic&lt;/span&gt;
        &lt;span class="n"&gt;msg&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;sarama&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ProducerMessage&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;Topic&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s"&gt;"messages"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;Value&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;sarama&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;StringEncoder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="n"&gt;partition&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;offset&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;producer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SendMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="c"&gt;// Return a response to the client&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;String&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;StatusOK&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Sprintf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Message published to partition %d at offset %d"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;partition&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;offset&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;

    &lt;span class="c"&gt;// Start the Echo web server&lt;/span&gt;
    &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Start&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;":8080"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This Go application uses the Echo framework to handle HTTP POST requests to the &lt;code&gt;/messages&lt;/code&gt; endpoint. When a request is received, the application reads the message body from the request and uses the &lt;code&gt;sarama&lt;/code&gt; package to publish the message to the "messages" topic in Kafka.&lt;/p&gt;

&lt;p&gt;Surprise, this article was generated by ChatGPT!&lt;/p&gt;

</description>
      <category>go</category>
      <category>tutorial</category>
      <category>abotwrotethis</category>
    </item>
  </channel>
</rss>
