func NewReadBucket(pathToData map[string][]byte) (storage.ReadBucket, error) {
	pathToImmutableObject := make(map[string]*internal.ImmutableObject, len(pathToData))
	for path, data := range pathToData {
		path, err := storageutil.ValidatePath(path)
		if err != nil {
			return nil, err
		}
		// This could happen if two paths normalize to the same path.
		if _, ok := pathToImmutableObject[path]; ok {
			return nil, errDuplicatePath
		}
		pathToImmutableObject[path] = internal.NewImmutableObject(path, "", data)
	}
	return newBucket(pathToImmutableObject), nil
}
// NewReadBucket returns a new ReadBucket.
NewReadBucket returns a new ReadBucket.
// NewReadBucket returns a new ReadBucket .
func NewReadBucket(pathToData map[string][]byte) (storage.ReadBucket, error) {
	pathToImmutableObject := make(map[string]*internal.ImmutableObject, len(pathToData))
	for path, data := range pathToData {
		path, err := storageutil.ValidatePath(path)
		if err != nil {
			return nil, err
		}
		if _, ok := pathToImmutableObject[path]; ok {
			return nil, errDuplicatePath
		}
		pathToImmutableObject[path] = internal.NewImmutableObject(path, "", data)
	}
	return newBucket(pathToImmutableObject), nil
}
func NewReadBucket ( pathToData map [ string ] [ ] byte ) ( storage . ReadBucket , error ) { pathToImmutableObject := make ( map [ string ] * internal . ImmutableObject , len ( pathToData ) ) for path , data := range pathToData { path , err := storageutil . ValidatePath ( path ) if err != nil { return nil , err } if _ , ok := pathToImmutableObject [ path ] ; ok { return nil , errDuplicatePath } pathToImmutableObject [ path ] = internal . NewImmutableObject ( path , " " , data ) } return newBucket ( pathToImmutableObject ) , nil }
NewReadBucket returns a new ReadBucket.
NewReadBucket returns a new ReadBucket .
// This could happen if two paths normalize to the same path.