code: func parseResolvConf(reader io.Reader) (nameservers []string, searches []string, options []string, err error) {
  	file, err := ioutil.ReadAll(reader)
  	if err != nil {
  		return nil, nil, nil, err
  	}
  
  	// Lines of the form "nameserver 1.2.3.4" accumulate.
  	nameservers = []string{}
  
  	// Lines of the form "search example.com" overrule - last one wins.
  	searches = []string{}
  
  	// Lines of the form "option ndots:5 attempts:2" overrule - last one wins.
  	// Each option is recorded as an element in the array.
  	options = []string{}
  
  	var allErrors []error
  	lines := strings.Split(string(file), "\n")
  	for l := range lines {
  		trimmed := strings.TrimSpace(lines[l])
  		if strings.HasPrefix(trimmed, "#") {
  			continue
  		}
  		fields := strings.Fields(trimmed)
  		if len(fields) == 0 {
  			continue
  		}
  		if fields[0] == "nameserver" {
  			if len(fields) >= 2 {
  				nameservers = append(nameservers, fields[1])
  			} else {
  				allErrors = append(allErrors, fmt.Errorf("nameserver list is empty "))
  			}
  		}
  		if fields[0] == "search" {
  			searches = fields[1:]
  		}
  		if fields[0] == "options" {
  			options = fields[1:]
  		}
  	}
  
  	return nameservers, searches, options, utilerrors.NewAggregate(allErrors)
  }
docs: // parseResolvConf reads a resolv.conf file from the given reader, and parses
  // it into nameservers, searches and options, possibly returning an error.