<?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>DEV Community: Quang Hieu (Bee)</title>
    <description>The latest articles on DEV Community by Quang Hieu (Bee) (@hieunguyendev).</description>
    <link>https://dev.to/hieunguyendev</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%2F1682807%2F6662f1a6-7f7b-4a2f-a4a1-c4978eefe26c.png</url>
      <title>DEV Community: Quang Hieu (Bee)</title>
      <link>https://dev.to/hieunguyendev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hieunguyendev"/>
    <language>en</language>
    <item>
      <title>Learn about the priority levels of config files and distinguish between .yaml and .properties files in Java Spring Boot.</title>
      <dc:creator>Quang Hieu (Bee)</dc:creator>
      <pubDate>Mon, 03 Mar 2025 17:45:07 +0000</pubDate>
      <link>https://dev.to/hieunguyendev/learn-about-the-priority-levels-of-config-files-and-distinguish-between-yaml-and-properties-files-26fi</link>
      <guid>https://dev.to/hieunguyendev/learn-about-the-priority-levels-of-config-files-and-distinguish-between-yaml-and-properties-files-26fi</guid>
      <description>&lt;p&gt;Hello everyone! Today, I will guide you through the priority levels of configuration files in a Java Spring Boot project and the differences between &lt;code&gt;.yaml&lt;/code&gt; and &lt;code&gt;.properties&lt;/code&gt; files. Let’s dive in!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Priority Levels of Configuration Files&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In Spring Boot, configuration files can be placed in various locations, each with its own priority level. The common structure of configuration files in a project is as follows:&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%2Fgiqlz4fuptht9455t6f7.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%2Fgiqlz4fuptht9455t6f7.PNG" alt="Image description" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The structure of configuration files in the project will be arranged in the following order of priority:&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%2Fc6m3kks7glb1edgr1jau.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%2Fc6m3kks7glb1edgr1jau.PNG" alt="Image description" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Checking the Priority Levels&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To test if the priority levels work as described, I changed the port in several configuration files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;File 1&lt;/strong&gt;: port 8080&lt;/li&gt;
&lt;/ul&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%2Fniwlgwp8m3vok708zjez.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%2Fniwlgwp8m3vok708zjez.PNG" alt="Image description" width="655" height="545"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;File 2&lt;/strong&gt;: port 8081&lt;/li&gt;
&lt;/ul&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%2Fi0srypphrrpoj3akwwgp.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%2Fi0srypphrrpoj3akwwgp.PNG" alt="Image description" width="692" height="558"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;File 3: port 8082&lt;/li&gt;
&lt;/ul&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%2Fd63tesmfqvanyp70x2du.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%2Fd63tesmfqvanyp70x2du.PNG" alt="Image description" width="679" height="552"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;File 4: port 8083&lt;/li&gt;
&lt;/ul&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%2F5732qcb6tiq8ne67fu1u.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%2F5732qcb6tiq8ne67fu1u.PNG" alt="Image description" width="674" height="556"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After running the application, the port that was set is 8080.&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%2Fr5fhkn2r2sj0rnaf4708.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%2Fr5fhkn2r2sj0rnaf4708.PNG" alt="Image description" width="800" height="445"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, I deleted the outermost configuration file and ran the application again. The result showed the port as 8081.&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%2Fvskwxdg1whvc3yeyiznw.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%2Fvskwxdg1whvc3yeyiznw.PNG" alt="Image description" width="800" height="492"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Similarly, you can test with the remaining configuration files.&lt;/p&gt;

&lt;p&gt;Isn’t it amazing? From these examples, we can clearly distinguish the priority of configuration files in a project.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Differentiating &lt;code&gt;.properties&lt;/code&gt; and &lt;code&gt;.yaml&lt;/code&gt; Files&lt;/strong&gt;&lt;br&gt;
In Java Spring Boot, both &lt;code&gt;.properties&lt;/code&gt; and &lt;code&gt;.yaml&lt;/code&gt; files are used to configure the application. However, they have some differences:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;.properties&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Simple "key-value" structure.&lt;/li&gt;
&lt;li&gt;Stores data as strings. For complex data types, additional processing is required.&lt;/li&gt;
&lt;li&gt;Example:
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;server.port=8080
spring.datasource.url=jdbc:mysql://localhost:3306/mydb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;.yaml&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Hierarchical structure, making it easy to read and organize complex information.&lt;/li&gt;
&lt;li&gt;Supports multiple data types (strings, numbers, arrays, objects, booleans), making the configuration more flexible.&lt;/li&gt;
&lt;li&gt;Example
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;server&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;8080&lt;/span&gt;
&lt;span class="na"&gt;spring&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;datasource&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;jdbc:mysql://localhost:3306/mydb&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4. Priority Levels When Both &lt;code&gt;.properties&lt;/code&gt; and &lt;code&gt;.yaml&lt;/code&gt; Files Exist&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let’s say we have both &lt;code&gt;.properties&lt;/code&gt; and &lt;code&gt;.yaml&lt;/code&gt; files in the project. Let’s check the priority level:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;File .properties&lt;/strong&gt;: port 8083&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%2Fp6sjx9ir0tqxci9xlx4h.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%2Fp6sjx9ir0tqxci9xlx4h.PNG" alt="Image description" width="679" height="444"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;File .yaml&lt;/strong&gt;: port 8084&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%2Fmnfs4m75b9v5l6bgwgl0.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%2Fmnfs4m75b9v5l6bgwgl0.PNG" alt="Image description" width="695" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After running the application, the port that was set is 8083.&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%2F1moc10u58zwfq4ib1we6.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%2F1moc10u58zwfq4ib1we6.PNG" alt="Image description" width="800" height="235"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;From the examples above, you should now have a clearer understanding of the priority levels of configuration files in Spring Boot and the differences between &lt;code&gt;.properties&lt;/code&gt; and &lt;code&gt;.yaml&lt;/code&gt;. I hope this article helps you gain more useful knowledge. If you found it helpful, don’t forget to leave me a reaction!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you found this article useful and interesting, please share it with your friends and family. I hope you found it helpful. Thanks for reading&lt;/strong&gt; 🙏&lt;/p&gt;

&lt;p&gt;Let's get connected! You can find me on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Medium: &lt;a href="https://quanghieudev.medium.com/" rel="noopener noreferrer"&gt;Quang Hieu (Bee) -- Medium&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Dev: &lt;a href="https://dev.to/hieunguyendev"&gt;Quang Hieu (Bee) -- Dev&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Linkedin: &lt;a href="https://www.linkedin.com/in/hi%E1%BA%BFu-nguy%E1%BB%85n-1a38132bb/" rel="noopener noreferrer"&gt;Quang Hieu (Bee) -- Linkedin&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Buy Me a Coffee: &lt;a href="https://buymeacoffee.com/quanghieudev" rel="noopener noreferrer"&gt;Quang Hieu (Bee) -- buymeacoffee&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>springboot</category>
      <category>java</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Gin and router example</title>
      <dc:creator>Quang Hieu (Bee)</dc:creator>
      <pubDate>Mon, 08 Jul 2024 17:34:09 +0000</pubDate>
      <link>https://dev.to/hieunguyendev/gin-and-router-example-2939</link>
      <guid>https://dev.to/hieunguyendev/gin-and-router-example-2939</guid>
      <description>&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%2Fxdpsnutre0wjmfyaxbdo.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%2Fxdpsnutre0wjmfyaxbdo.png" alt="Image description" width="311" height="162"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install Gin with the following command:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;go get -u github.com/gin-gonic/gin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;After installation, we proceed to code in the “main.go” file with a simple function as follows:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package main

import (
  "net/http"

  "github.com/gin-gonic/gin"
)

func main() {
  r := gin.Default()
  r.GET("/ping", func(c *gin.Context) {
    c.JSON(http.StatusOK, gin.H{
      "message": "pong",
    })
  })
  r.Run() // listen and serve on 0.0.0.0:8080 (for windows "localhost:8080")
}

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Then run the main file with the following command:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;go run cmd/server/main.go
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Depending on your folder organization, the command to run the main.go file may differ from mine. I have introduced how to organize the structure in the article: &lt;a href="https://dev.to/hieunguyendev/backend-project-structure-go-1ph8"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;After running the above command, we will receive the following result:&lt;/li&gt;
&lt;/ul&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%2Fr8kl1i25golok7v1bz6c.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%2Fr8kl1i25golok7v1bz6c.png" alt="Image description" width="800" height="602"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Great, let's try calling the ping endpoint with the following command:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl http://localhost:8080/ping
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The result received will be:&lt;/li&gt;
&lt;/ul&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%2Fyrgm9lja4fq2h4b1urmz.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%2Fyrgm9lja4fq2h4b1urmz.png" alt="Image description" width="800" height="537"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Now, let's try to split the simple router:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package main

import (
    "net/http"

    "github.com/gin-gonic/gin"
)

func main() {
    r := gin.Default()

    v1 := r.Group("/v1")
    {
        v1.GET("/ping", Pong) // curl http://localhost:8080/v1/ping
    }
    r.Run() // listen and serve on 0.0.0.0:8080 (for windows "localhost:8080")
}

func Pong(c *gin.Context) {
    c.JSON(http.StatusOK, gin.H{
        "message": "pong",
    })
}

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; After changing the code as above, remember to run the command: "go run cmd/server/main.go" to apply the new code.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Next, let's try running the new router with the following command:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl http://localhost:8080/v1/ping
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The result received will be:&lt;/li&gt;
&lt;/ul&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%2Fbiizdoc9s8txvrni01hs.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%2Fbiizdoc9s8txvrni01hs.png" alt="Image description" width="800" height="535"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Now, let's try to get the parameter from Param:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package main

import (
    "net/http"

    "github.com/gin-gonic/gin"
)

func main() {
    r := gin.Default()

    v1 := r.Group("/v1")
    {
        v1.GET("/ping/:name", Pong) // curl http://localhost:8080/v1/ping
    }
    r.Run() // listen and serve on 0.0.0.0:8080 (for windows "localhost:8080")
}

func Pong(c *gin.Context) {
    name := c.Param("name")
    c.JSON(http.StatusOK, gin.H{
        "message": "pong:::: " + name,
    })
}

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; After changing the code as above, remember to run the command: "go run cmd/server/main.go" to apply the new code.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Try to get the param with the following command:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl http://localhost:8080/v1/ping/hieunguyen
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The result received will be:&lt;/li&gt;
&lt;/ul&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%2Frpwqqr2fyixxrd30951x.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%2Frpwqqr2fyixxrd30951x.png" alt="Image description" width="800" height="535"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Next, we will try to get the parameter from the Query:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package main

import (
    "net/http"

    "github.com/gin-gonic/gin"
)

func main() {
    r := gin.Default()

    v1 := r.Group("/v1")
    {
        v1.GET("/ping", Pong) // curl http://localhost:8080/v1/ping
    }
    r.Run() // listen and serve on 0.0.0.0:8080 (for windows "localhost:8080")
}

func Pong(c *gin.Context) {
    id := c.Query("id")
    c.JSON(http.StatusOK, gin.H{
        "message": "pong:::: " + id,
    })
}

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; After changing the code as above, remember to run the command: "go run cmd/server/main.go" to apply the new code.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Try to get the query with the following command:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl http://localhost:8080/v1/ping\?id=12345
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The result received will be:&lt;/li&gt;
&lt;/ul&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%2Fmloz5pap0rg1nr15gce3.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%2Fmloz5pap0rg1nr15gce3.png" alt="Image description" width="800" height="534"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can directly refer to Gin on GitHub with the following link:&lt;a href="https://github.com/gin-gonic/gin" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Give me a reaction and a follow for motivation&lt;/strong&gt; 😘&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you found this article useful and interesting, please share it with your friends and family. I hope you found it helpful. Thanks for reading&lt;/strong&gt; 🙏&lt;/p&gt;

&lt;p&gt;Let's get connected! You can find me on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Medium: &lt;a href="https://quanghieudev.medium.com/" rel="noopener noreferrer"&gt;Quang Hieu (Bee) -- Medium&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Dev: &lt;a href="https://dev.to/hieunguyendev"&gt;Quang Hieu (Bee) -- Dev&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Linkedin: &lt;a href="https://www.linkedin.com/in/hi%E1%BA%BFu-nguy%E1%BB%85n-1a38132bb/" rel="noopener noreferrer"&gt;Quang Hieu (Bee) -- Linkedin&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Buy Me a Coffee: &lt;a href="https://buymeacoffee.com/quanghieudev" rel="noopener noreferrer"&gt;Quang Hieu (Bee) -- buymeacoffee&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>go</category>
      <category>gin</category>
      <category>beginners</category>
      <category>backend</category>
    </item>
    <item>
      <title>Backend Project Structure Go</title>
      <dc:creator>Quang Hieu (Bee)</dc:creator>
      <pubDate>Sun, 07 Jul 2024 16:22:21 +0000</pubDate>
      <link>https://dev.to/hieunguyendev/backend-project-structure-go-1ph8</link>
      <guid>https://dev.to/hieunguyendev/backend-project-structure-go-1ph8</guid>
      <description>&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%2Fgua11oo3vn1wsvjuas7d.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%2Fgua11oo3vn1wsvjuas7d.png" alt="Image description" width="311" height="162"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hi everyone, today I want to share a Go project structure that I have used and found useful. This project structure is suitable for medium and small projects, and even large projects. The way folders and files are organized in this project structure is similar to other programming languages such as NodeJS or Java. This helps everyone to have a more comprehensive and easier understanding when learning about Go. I hope it will be useful and here is my Go project structure.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.
├── cmd/               # Contains executable applications
│   ├── cli/           # Command-line application
│   ├── cronjob/       # Scheduled jobs
│   └── server/        # Server application
│      └── main.go     # Run the application
├── config/            # Configuration for applications
│   └── config.yaml    # Main configuration file
├── docs/              # Project documentation
├── global/            # Global variables
├── internal/          # Internal packages
│   ├── controller/    # Handle client requests
│   ├── initialize/    # Initialize necessary components
│   ├── middlewares/   # Server middlewares
│   ├── models/        # Structs representing data
│   ├── repo/          # Query data from the database
│   ├── routers/       # Define routes for the server
│   ├── service/       # Handle business logic
├── migrations/        # Database migration scripts
├── pkg/               # Reusable packages
│   ├── logger/        # Logging for the application
│   ├── response/      # Handle response to the client
│   ├── setting/       # Application settings
│   └── utils/         # Utility functions
├── scripts/           # Development support scripts
├── tests/             # Test cases for the application
├── third_party/       # Third-party libraries
├── .gitignore         # Git ignore file
├── go.mod             # Go dependencies management
├── go.sum             # Contains checksums of dependencies
├── LICENSE            # Project license
└── README.md          # Project description
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the result of my project structure on Visual Studio Code&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%2Fiy4pomil0qm4dcv87n8q.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%2Fiy4pomil0qm4dcv87n8q.png" alt="Image description" width="371" height="685"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you found this article useful and interesting, please share it with your friends and family. I hope you found it helpful. Thanks for reading&lt;/strong&gt; 🙏&lt;/p&gt;

&lt;p&gt;Let's get connected! You can find me on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Medium: &lt;a href="https://quanghieudev.medium.com/" rel="noopener noreferrer"&gt;Quang Hieu (Bee) -- Medium&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Dev: &lt;a href="https://dev.to/hieunguyendev"&gt;Quang Hieu (Bee) -- Dev&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Linkedin: &lt;a href="https://www.linkedin.com/in/hi%E1%BA%BFu-nguy%E1%BB%85n-1a38132bb/" rel="noopener noreferrer"&gt;Quang Hieu (Bee) -- Linkedin&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Buy Me a Coffee: &lt;a href="https://buymeacoffee.com/quanghieudev" rel="noopener noreferrer"&gt;Quang Hieu (Bee) -- buymeacoffee&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>go</category>
      <category>beginners</category>
      <category>backend</category>
      <category>projectstructure</category>
    </item>
    <item>
      <title>Initialize a Go project with “go-blueprint”</title>
      <dc:creator>Quang Hieu (Bee)</dc:creator>
      <pubDate>Tue, 25 Jun 2024 17:47:18 +0000</pubDate>
      <link>https://dev.to/hieunguyendev/initialize-a-go-project-with-go-blueprint-2bd1</link>
      <guid>https://dev.to/hieunguyendev/initialize-a-go-project-with-go-blueprint-2bd1</guid>
      <description>&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%2Fby0xm5vckr5d5wmh5p4i.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%2Fby0xm5vckr5d5wmh5p4i.png" alt="Image description" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step-by-step guide to initiating a Go project. Make sure you have Go installed on your machine. You can download it from the official Go website 👉 &lt;a href="https://golang.org/dl/" rel="noopener noreferrer"&gt;https://golang.org/dl/&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Step 1: Open terminal:&lt;/strong&gt;&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%2Fyr38o7ixr210gu3s5u08.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%2Fyr38o7ixr210gu3s5u08.png" alt="Image description" width="800" height="369"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Install go-blueprint with the following command:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;go install github.com/melkeydev/go-blueprint@latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fw8rzitefzrq4mg2zlcgv.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%2Fw8rzitefzrq4mg2zlcgv.png" alt="Image description" width="800" height="499"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Open the "go-blueprint" tool on the browser with the following link:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://go-blueprint.dev/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 4: Fill in the necessary information of the project into the form such as projectName, database, framework, and some advanced options if used:&lt;/strong&gt;&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%2Fvw5o6o22s5u26acijrzr.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%2Fvw5o6o22s5u26acijrzr.png" alt="Image description" width="800" height="526"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;From the information we filled in the form, we will receive an order as shown in the picture.&lt;/li&gt;
&lt;/ul&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%2F7kcoo55104auvwhe7eg1.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%2F7kcoo55104auvwhe7eg1.png" alt="Image description" width="800" height="45"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5: Copy the command, paste it into the terminal and press enter:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;go-blueprint create --name my_project --framework gin --driver mongo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fflww1hn5g7sinkfz1t5o.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%2Fflww1hn5g7sinkfz1t5o.png" alt="Image description" width="800" height="498"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you encounter the "command not found" error as below, follow the next steps in step 5. Otherwise, you can proceed to step 6&lt;/li&gt;
&lt;/ul&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%2Fxsnq5nvnctv4zkbzp532.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%2Fxsnq5nvnctv4zkbzp532.png" alt="Image description" width="800" height="52"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5.1: Run command:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GOPATH=$HOME/go
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 5.2: Run command:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2F3jpkshud087220rimfl6.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%2F3jpkshud087220rimfl6.png" alt="Image description" width="800" height="55"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So it's already fixed. You can refer to the error at the link: &lt;a href="https://github.com/Melkeydev/go-blueprint/issues/166" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5.3: Then run the command:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;go-blueprint create --name my_project --framework gin --driver mongo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 6: When run successfully, we will get results as shown:&lt;/strong&gt;&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%2Fbu1vrfqwdix933gtz1lg.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%2Fbu1vrfqwdix933gtz1lg.png" alt="Image description" width="800" height="411"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 7: Open the project with Visual Studio Code&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enter the "my_project" directory using the command
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd my_project
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Open the project quickly with Visual Studio Code using command
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;code .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Futopp3stldjlbkw6nguq.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%2Futopp3stldjlbkw6nguq.png" alt="Image description" width="800" height="351"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This is the result received&lt;/li&gt;
&lt;/ul&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%2Fq573yfa2h9ddcz3d4kp9.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%2Fq573yfa2h9ddcz3d4kp9.png" alt="Image description" width="800" height="440"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;That's a great tool. So we have successfully initiated a Go project with "go-blueprint". To continue running the project we just initiated, we perform the following steps&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 8: Open the main.go file in the cmd/api folder and add the following line:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fmt.Println("Hello, World!")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fl1x7me6ta06y8ws185ig.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%2Fl1x7me6ta06y8ws185ig.png" alt="Image description" width="800" height="379"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 9: Open terminal and run command:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;make run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fjc53r4z8fq8xltujpxai.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%2Fjc53r4z8fq8xltujpxai.png" alt="Image description" width="800" height="407"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have finally completed the initialization of the Go project and successfully ran the project.&lt;/p&gt;

&lt;p&gt;You can refer to "Go-blueprint" here 👉 &lt;a href="https://github.com/Melkeydev/go-blueprint" rel="noopener noreferrer"&gt;Go-blueprint&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you found this article useful and interesting, please share it with your friends and family. I hope you found it helpful. Thanks for reading&lt;/strong&gt; 🙏&lt;/p&gt;

&lt;p&gt;Let's get connected! You can find me on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Medium: &lt;a href="https://quanghieudev.medium.com/" rel="noopener noreferrer"&gt;Quang Hieu (Bee) -- Medium&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Dev: &lt;a href="https://dev.to/hieunguyendev"&gt;Quang Hieu (Bee) -- Dev&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Linkedin: &lt;a href="https://www.linkedin.com/in/hi%E1%BA%BFu-nguy%E1%BB%85n-1a38132bb/" rel="noopener noreferrer"&gt;Quang Hieu (Bee) -- Linkedin&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Buy Me a Coffee: &lt;a href="https://buymeacoffee.com/quanghieudev" rel="noopener noreferrer"&gt;Quang Hieu (Bee) -- buymeacoffee&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>go</category>
      <category>beginners</category>
      <category>initgo</category>
      <category>goblueprint</category>
    </item>
  </channel>
</rss>
