title: Config files and Golang or just beginner mistake
body: <p>I have done a few tutorials in Go and wanted to try something much more relevant that is going to needed from me relatively soon. Im starting by looking at viper and cobra. I understand the config file is actually for viper to use and cobra is just handling things with it. However, Im stuck on even getting past that point. Ill likely run into a few more errors but I am stuck on this one and any help I find doesnt really make any sense to aid my issue. So I have a decent background in C/C++. And from the reading ampersands and asteriks are used in a similar fashion. Thats why Im having trouble with this. </p>
  
  <pre><code>func init() {
       cobra.OnInitialize(initConfig)
       rootCmd.PersistentFlags().StringVar(&amp;cfgFile, "config", "", "config file (default is $Home/.cobra.yaml)")
       rootCmd.PersistentFlags().StringVarP(&amp;projectBase,"projectbase", "b", "", "base project direcoty eg. github.com")
       rootCmd.PersistentFlags().StringP("author", "a", "Rutger", "Written by rutger")
       rootCmd.PersistentFlags().StringVarP(&amp;userLicense, "license", "l", "", "My license homie")
       viper.BindPFlag("author", rootCmd. PersistentFlags().Lookup("author"))
       viper.BindPFlag("projectbase", rootCmd.PersistentFlags().Lookup("projectbase"))
       viper.BindPFlag("useViper", rootCmd.PersistentFlags().Lookup("viper"))
       viper.SetDefault("author", "Rutger Luther &lt;rutger.luther@printtrackerpro.com")
       viper.SetDefault("license", "nachos")
  }
  </code></pre>
  
  <p>This is basically the example used for viper and cobra from here.  <a href="https://github.com/spf13/cobra" rel="nofollow noreferrer">Go Cobra</a></p>
  
  <p>The issue is im getting these errors.  </p>
  
  <pre><code>cmd\root.go:25:40: undefined: projectBase
  cmd\root.go:27:40: undefined: userLicense
  cmd\root.go:39:15: undefined: homedir
  </code></pre>
  
  <p>Im making the calls to these for the first time so Im not sure how they would have any values. I apologize if this is a really simply question. But some of these Go pages are a bit more difficult to understand.</p>