title: Golang how to install lib with go mod command
body: <p>I searched some article, all they used this why:</p>
  <pre><code>$go mod init project_name
  </code></pre>
  <p>Then created main.go and coded these:</p>
  <pre><code>package main
  
  import &quot;github.com/gin-gonic/gin&quot;
  
  func main() {
   r := gin.Default()
   r.GET(&quot;/ping&quot;, func(c *gin.Context) {
       c.JSON(200, gin.H{
           &quot;message&quot;: &quot;pong&quot;,
       })
   })
   r.Run() // listen and serve on 0.0.0.0:8080 (for windows &quot;localhost:8080&quot;)
  }
  </code></pre>
  <p>then <code>go run main.go</code></p>
  <p>but in the fact, I can't remember the lib's full name like <code>&quot;github.com/gin-gonic/gin&quot;</code>, maybe I just remember <code>gin</code>.</p>
  <p>So is there some way to install lib like python pip tool or <code>go get</code> like <code>go mod install gin</code></p>
  <hr />
  <p>PS:</p>
  <p>because that I am using goland as my IDE, under the GOPATH, I can get the code tips, but under the go mod, I couldn't get it, Then I have started the question of this.</p>