code: func (h *Hooks) LoadFromFile(path string, asTemplate bool) error {
  	if path == "" {
  		return nil
  	}
  
  	// parse hook file for hooks
  	file, e := ioutil.ReadFile(path)
  
  	if e != nil {
  		return e
  	}
  
  	if asTemplate {
  		funcMap := template.FuncMap{"getenv": getenv}
  
  		tmpl, err := template.New("hooks").Funcs(funcMap).Parse(string(file))
  		if err != nil {
  			return err
  		}
  
  		var buf bytes.Buffer
  
  		err = tmpl.Execute(&buf, nil)
  		if err != nil {
  			return err
  		}
  
  		file = buf.Bytes()
  	}
  
  	e = yaml.Unmarshal(file, h)
  	return e
  }
docs: // LoadFromFile attempts to load hooks from the specified file, which
  // can be either JSON or YAML.  The asTemplate parameter causes the file
  // contents to be parsed as a Go text/template prior to unmarshalling.