title: Is a process the same as a Goroutine in Golang?
body: <p>For the following code:</p>
  
  <pre><code>func main() {
      goRtns := runtime.NumGoroutine()
      fmt.Println("goroutines:", goRtns)
  }
  </code></pre>
  
  <p>The output is <code>1</code>. But this is within a "process," with no goroutines being explicitly called:</p>
  
  <p>"In computing, a process is an instance of a computer program that is being executed. It contains the program code and its current activity. Depending on the operating system (OS), a process may be made up of multiple threads of execution that execute instructions concurrently."</p>
  
  <p>Also from the excellent "How goroutines work" blog post by Krishna Sundarram: <a href="http://blog.nindalf.com/how-goroutines-work/" rel="noreferrer">http://blog.nindalf.com/how-goroutines-work/</a></p>
  
  <p>"The creation of a goroutine does not require much memory - only 2kB of stack space. They grow by allocating and freeing heap storage as required." </p>
  
  <p>My question is this, then: the instance of code that is running (my simple main.go function) is counted as a goroutine by the runtime library. Am I to assume that the parent process is treated as a go routine, with the same rules of memory allocation, garbage collection, etc? Would it be wise to assume reading a fact about a goroutine's execution is analogous to the overarching go process that runs it? With respect to the second quote on goroutines above, this sounds like a process growing/shrinking its stack space as a program executes which is a standard paradigm in programming. </p>
  
  <p>Do go processes and routines share the same rules? Or am I just missing something about the reported number of goroutines. </p>