title: Golang Binary Search Tree Algorithm Translation
body: <p>I'm beginner to Golang and trying to build a Binary Search Tree. My source code to do it:</p>
  
  <pre><code>package main
  
  import (
      "fmt"
      "math/rand"
      "time"
  )
  
  type Node struct{
      value int
      left *Node
      right *Node
  }
  
  func insert(root *Node,v int){
      if root==nil{
          root=&amp;Node{v,nil,nil}
      } else if v&lt;root.value{
          insert(root.left,v)
      } else{
          insert(root.right,v)
      }
  }
  
  func inTraverse(root *Node){
      if (root==nil){
          return
      }
      inTraverse(root.left)
      fmt.Printf("%d",root.value)
      inTraverse(root.right)
  }
  
  func main() {
      var treeRoot *Node
      rand.Seed(time.Now().UnixNano())
      n:=6
      var a[6]int
      for i:=0;i&lt;n;i++{
          a[i]=rand.Intn(20)+1
      }
      fmt.Println("Array of integer: ")
      for i:=0;i&lt;n;i++{
          fmt.Printf("%d ",a[i])
      }
      fmt.Println()
      for i:=0;i&lt;n;i++{
          insert(treeRoot,a[i])
      }
      inTraverse(treeRoot)
      fmt.Println()
  }
  </code></pre>
  
  <p>The result shows an empty tree. What's wrong with my code? Does Golang have pass-by-value or pass-by-reference? Please help me solve this.</p>