code: func parseHTPasswd(rd io.Reader) (map[string][]byte, error) {
  	entries := map[string][]byte{}
  	scanner := bufio.NewScanner(rd)
  	var line int
  	for scanner.Scan() {
  		line++ // 1-based line numbering
  		t := strings.TrimSpace(scanner.Text())
  
  		if len(t) < 1 {
  			continue
  		}
  
  		// lines that *begin* with a '#' are considered comments
  		if t[0] == '#' {
  			continue
  		}
  
  		i := strings.Index(t, ":")
  		if i < 0 || i >= len(t) {
  			return nil, fmt.Errorf("htpasswd: invalid entry at line %d: %q", line, scanner.Text())
  		}
  
  		entries[t[:i]] = []byte(t[i+1:])
  	}
  
  	if err := scanner.Err(); err != nil {
  		return nil, err
  	}
  
  	return entries, nil
  }
docs: // parseHTPasswd parses the contents of htpasswd. This will read all the
  // entries in the file, whether or not they are needed. An error is returned
  // if a syntax errors are encountered or if the reader fails.