Skip to content

whosonfirst/go-whosonfirst-writer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-whosonfirst-writer

Common methods for writing Who's On First documents.

Documentation

Go Reference

Examples

Note that error handling has been removed for the sake of brevity.

WriteBytes

import (
	"context"
	"flag"
	"github.com/whosonfirst/go-writer"	
	wof_writer "github.com/whosonfirst/go-whosonfirst-writer"
	"io"
)

func main() {

	flag.Parse()

	ctx := context.Background()
	wr, _ := writer.NewWriter(ctx, "stdout://")
	
	for _, feature_path := range flag.Args() {
	
		r, _ := os.Open(feature_path)
		defer r.Close()
		
		body, _ := io.ReadAll(r)
		wof_writer.WriteBytes(ctx, wr, body)
	}

See also