Categorygithub.com/sfomuseum/go-atomicwrite
repositorypackage
1.0.0
Repository: https://github.com/sfomuseum/go-atomicwrite.git
Documentation: pkg.go.dev

# README

go-atomicwrite

Go package to implement an atomic io.WriteCloser instance backed by the gocloud.dev/blob package.

Documentation

Go Reference

Example

import (
	"context"
	"fmt"
	"github.com/sfomuseum/go-atomicwrite"
)

func main(){

	ctx := context.Background()
	
	fname := "atomicwrite.txt"
	uri := fmt.Sprintf("mem://%s", fname)

	wr, _ := atomicwrite.New(ctx, uri)
	wr.Write([]byte("Hello world"))
	wr.Close()
}

Error handling omitted for the sake of brevity.

See also