code: func lockedNewOutput(uri string) (o *outputWrapper, err error) {
  	o, ok := outputMap[uri]
  	if ok == true {
  		return o, nil
  	}
  
  	// Attempt to parse the URL into something useful.
  	u, err := url.Parse(uri)
  	if err != nil {
  		return nil, err
  	}
  
  	// Get the generation function an call it.
  	f, ok := newOutputFuncMap[u.Scheme]
  	if ok != true || f == nil {
  		return nil, fmt.Errorf("Unknown url scheme: '%s'", u.Scheme)
  	}
  
  	// Get the output object for this registered scheme type.
  	output, err := f(u)
  	if err != nil {
  		return nil, err
  	} else if output == nil {
  		return nil, fmt.Errorf("NewOutputFunc can not return nil, nil")
  	}
  
  	// Add the new object back to the map to ensure it gets reused later rather
  	// than being constantly recreated.
  	wrapper := &outputWrapper{
  		Output: output,
  		URL:    u,
  	}
  	outputMap[uri] = wrapper
  
  	return wrapper, nil
  }
docs: // Inner locked code for NewOutput()