whosonfirst / go-whosonfirst-exportify

Tools (written in Go) for exporting Who's On First records.
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

deps: update whosonfirst/go-reader #5

Closed missinglink closed 3 years ago

missinglink commented 3 years ago

as per discussion in https://github.com/whosonfirst/go-whosonfirst-exportify/issues/3#issuecomment-902193193 this PR updates the whosonfirst/go-reader dependency to the latest version.

go get -u github.com/whosonfirst/go-reader
go mod vendor

this might need another commit to get it working, I tried a few methods and I couldn't get it to output anything 🤷‍♂️

cat berlin.geojson \
  | ./bin/exportify \
    -reader-uri stdin:// -

2021/08/20 10:42:32 Failed to create writer for 'fs:///code/whosonfirst/go-whosonfirst-exportify/data', stat /code/whosonfirst/go-whosonfirst-exportify/data: no such file or directory

{exit 1}
cat berlin.geojson \
  | ./bin/exportify \
    -writer-uri stdout:// \
    -reader-uri stdin:// -

{no output, exit 0}

note: the order of commands affects the execution, I assumed -writer-uri stdout:// was the default, but this seems to not be the case?

cat berlin.geojson \
  | ./bin/exportify \
    -reader-uri stdin:// - \
    -writer-uri stdout://

2021/08/20 10:46:23 Failed to create writer for 'fs:///code/whosonfirst/go-whosonfirst-exportify/data', stat /code/whosonfirst/go-whosonfirst-exportify/data: no such file or directory

{exit 1}

Regarding stdin:// - the - seems redundant here, do I need to include that or use it in for both stdin & stdout?

thisisaaronland commented 3 years ago

The "-" or any other path for a reader.Reader instance comes at the end of the command. It is the equivalent of flag.Args