title: Read a golang file and replace word search with uppercase
body: <p>I am trying to search for or a particular words in the files in a directory and and convert each of its instance in all the file in Uppercase. </p>
  
  <p>I want to keep track of the file where the word was found and how many time it appeared in those file. </p>
  
  <p>So far I am able to read the content of the file.<br>
  How do send an argument then from the main function to search through the file and replace those instance into upper case?</p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>func visit(path string, fi os.FileInfo, err error) error {
  
      if err!=nil{
          return err
       }
  
       if !!fi.IsDir(){
          return nil //
       }
  
        matched, err := filepath.Match("*.txt", fi.Name())
  
        if err !=nil{
          fmt.Println(err)
          return err
        }
  
        if matched{
        read,err:= ioutil.ReadFile(path)
        fmt.Println(read)
        check(err)
        fmt.Println(path) }
  
    return nil
  } 
  
  func main() {
  
    err := filepath.Walk(".", visit)
  }
  </code></pre>