code: func NewParser(prefix string, parseInfos []VersionedParseInfo) *Parser {
  	p := Parser{prefix: prefix, mapping: make(map[Version]VersionedParseInfo)}
  
  	for _, parseInfo := range parseInfos {
  		p.mapping[parseInfo.Version] = parseInfo
  	}
  
  	for _, env := range os.Environ() {
  		envParts := strings.SplitN(env, "=", 2)
  		p.env = append(p.env, envVar{envParts[0], envParts[1]})
  	}
  
  	// We must sort the environment variables lexically by name so that
  	// more specific variables are applied before less specific ones
  	// (i.e. REGISTRY_STORAGE before
  	// REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY). This sucks, but it's a
  	// lot simpler and easier to get right than unmarshalling map entries
  	// into temporaries and merging with the existing entry.
  	sort.Sort(p.env)
  
  	return &p
  }
docs: // NewParser returns a *Parser with the given environment prefix which handles
  // versioned configurations which match the given parseInfos