code: func (hl *hashList) DecodeAndVerify(r io.Reader) error {
  	// Read the file and make sure everything in there has a matching hash.
  	seen := make(map[string]struct{})
  	s := bufio.NewScanner(r)
  	for s.Scan() {
  		sha := make([]byte, sha256.Size)
  		var file string
  		if _, err := fmt.Sscanf(s.Text(), "%x  %s", &sha, &file); err != nil {
  			return err
  		}
  
  		h, ok := hl.hashes[file]
  		if !ok {
  			return fmt.Errorf("list missing hash for %q", file)
  		}
  		if !bytes.Equal(sha, h.Sum([]byte{})) {
  			return fmt.Errorf("hash check failed for %q", file)
  		}
  		seen[file] = struct{}{}
  	}
  	if err := s.Err(); err != nil {
  		return err
  	}
  
  	// Make sure everything we had a hash for was seen.
  	for file := range hl.hashes {
  		if _, ok := seen[file]; !ok {
  			return fmt.Errorf("file missing for %q", file)
  		}
  	}
  
  	return nil
  }
docs: // DecodeAndVerify reads a SHA256SUMS-style text file and checks the results
  // against the current sums for all the hashes.