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

remove vendor directory #8

Open missinglink opened 2 years ago

missinglink commented 2 years ago

Is there still a need to vendor dependencies in with the source, with the modern go versioning can't we just rely on the git tags in go.mod for consistency?

thisisaaronland commented 2 years ago

I'm not sure I understand why we would remove the vendor directory since the point of it is to be able to build these tools straight from the repo (which bundles all its dependencies in vendor).

missinglink commented 2 years ago

It still works the same way without vendoring, the go build command downloads the modules from the internet based on the versions specified in go.{mod,sum}.

eg:

FROM golang:1.19-alpine

RUN apk update
RUN apk add git alpine-sdk

RUN git clone https://github.com/missinglink/go-whosonfirst-exportify.git /tmp/exportify
WORKDIR /tmp/exportify

RUN git checkout unvendor
RUN make cli
...

#11 [7/7] RUN make cli
#11 sha256:80cf331dcdaf4cfd43f1c5e6b90ff787bde43939add5559659411b629a73e5aa
#11 0.241 go build -o bin/wof-assign-geometry cmd/wof-assign-geometry/main.go
#11 1.276 go: downloading github.com/whosonfirst/go-whosonfirst-export/v2 v2.4.5
#11 1.276 go: downloading github.com/tidwall/sjson v1.2.4
#11 1.276 go: downloading github.com/tidwall/gjson v1.14.1
#11 1.276 go: downloading github.com/whosonfirst/go-reader v1.0.1
#11 1.310 go: downloading github.com/whosonfirst/go-whosonfirst-reader v1.0.1
#11 1.310 go: downloading github.com/whosonfirst/go-writer v1.0.1
#11 1.311 go: downloading github.com/whosonfirst/go-whosonfirst-writer v1.0.0
#11 1.362 go: downloading github.com/aaronland/go-roster v1.0.0
#11 1.363 go: downloading github.com/whosonfirst/go-whosonfirst-format v0.3.7
#11 1.377 go: downloading github.com/whosonfirst/go-whosonfirst-id v0.0.4
#11 1.382 go: downloading github.com/tidwall/match v1.1.1
#11 1.462 go: downloading github.com/tidwall/pretty v1.2.0
#11 1.498 go: downloading github.com/paulmach/orb v0.7.1
#11 1.500 go: downloading github.com/sfomuseum/go-edtf v1.1.1
#11 1.516 go: downloading github.com/whosonfirst/go-ioutil v1.0.2
#11 1.519 go: downloading github.com/aaronland/go-brooklynintegers-api v1.2.4
#11 1.520 go: downloading github.com/aaronland/go-uid v0.0.3
#11 1.522 go: downloading github.com/aaronland/go-uid-artisanal v0.0.1
#11 1.559 go: downloading github.com/whosonfirst/go-whosonfirst-feature v0.0.23
#11 1.559 go: downloading github.com/whosonfirst/go-whosonfirst-uri v1.2.0
#11 1.559 go: downloading github.com/g8rswimmer/error-chain v1.0.0
#11 1.560 go: downloading github.com/natefinch/atomic v1.0.1
#11 1.582 go: downloading github.com/aaronland/go-artisanal-integers v0.1.1
#11 1.583 go: downloading github.com/aaronland/go-artisanal-integers-proxy v0.2.5
#11 1.590 go: downloading github.com/aaronland/go-pool v1.0.0
#11 1.591 go: downloading github.com/cenkalti/backoff/v4 v4.1.2
#11 1.593 go: downloading go.uber.org/ratelimit v0.2.0
#11 1.602 go: downloading github.com/aaronland/go-string v0.1.2
#11 1.719 go: downloading github.com/whosonfirst/go-whosonfirst-sources v0.1.0
#11 1.726 go: downloading github.com/whosonfirst/go-whosonfirst-flags v0.4.3
#11 1.740 go: downloading github.com/whosonfirst/go-whosonfirst-log v0.1.0
#11 1.756 go: downloading github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129
#11 4.188 go build -o bin/wof-assign-parent cmd/wof-assign-parent/main.go
#11 4.206 go: downloading github.com/sfomuseum/go-flags v0.8.3
#11 4.945 go build -o bin/wof-exportify cmd/wof-exportify/main.go
#11 5.479 go build -o bin/wof-create cmd/wof-create/main.go
#11 5.494 go: downloading github.com/whosonfirst/go-whosonfirst-spatial-hierarchy v0.1.1
#11 5.494 go: downloading github.com/whosonfirst/go-whosonfirst-spatial-sqlite v0.5.0
#11 5.494 go: downloading github.com/whosonfirst/go-whosonfirst-spatial v0.3.4
#11 5.500 go: downloading github.com/whosonfirst/go-whosonfirst-writer/v2 v2.0.0
#11 5.714 go: downloading github.com/whosonfirst/go-whosonfirst-spr/v2 v2.2.1
#11 5.714 go: downloading github.com/sfomuseum/go-sfomuseum-mapshaper v0.0.1
#11 5.714 go: downloading github.com/whosonfirst/go-whosonfirst-placetypes v0.3.0
#11 5.874 go: downloading github.com/whosonfirst/go-whosonfirst-iterate/v2 v2.1.0
#11 5.875 go: downloading github.com/whosonfirst/go-sanitize v0.1.0
#11 6.306 go: downloading github.com/aaronland/go-json-query v0.1.2
#11 6.306 go: downloading github.com/whosonfirst/go-whosonfirst-crawl v0.2.1
#11 6.532 go: downloading github.com/whosonfirst/walk v0.0.1
#11 6.869 go: downloading github.com/whosonfirst/go-whosonfirst-sqlite-spr v0.3.2
#11 6.869 go: downloading github.com/patrickmn/go-cache v2.1.0+incompatible
#11 6.869 go: downloading github.com/aaronland/go-sqlite v0.1.1
#11 6.869 go: downloading github.com/whosonfirst/go-whosonfirst-sqlite-features v0.10.0
#11 6.920 go: downloading github.com/aaronland/go-pagination-sql v0.2.0
#11 6.920 go: downloading github.com/aaronland/go-pagination v0.2.0
#11 6.979 go: downloading github.com/mattn/go-sqlite3 v1.14.12
#11 6.981 go: downloading github.com/jtacoma/uritemplates v1.0.0
#11 7.016 go: downloading github.com/whosonfirst/go-whosonfirst-names v0.1.0
#11 7.268 go: downloading github.com/whosonfirst/go-rfc-5646 v0.1.0
#11 68.20 go build -o bin/wof-deprecate cmd/wof-deprecate/main.go
#11 68.70 go build -o bin/wof-cessate cmd/wof-cessate/main.go
#11 69.17 go build -o bin/wof-superseded-by cmd/wof-superseded-by/main.go
#11 69.66 go build -o bin/wof-ensure-properties cmd/wof-ensure-properties/main.go
#11 69.68 go: downloading github.com/whosonfirst/go-whosonfirst-iterate-reader v1.0.0
#11 70.42 go build -o bin/wof-deprecate-and-supersede cmd/wof-deprecate-and-supersede/main.go
#11 70.95 go build -o bin/wof-merge-featurecollection cmd/wof-merge-featurecollection/main.go
#11 71.45 go build -o bin/wof-supersede-with-parent cmd/wof-supersede-with-parent/main.go
#11 71.91 go build -o bin/wof-as-featurecollection cmd/wof-as-featurecollection/main.go
#11 71.93 go: downloading github.com/whosonfirst/go-writer-featurecollection v0.0.2
#11 72.40 go build -o bin/wof-as-jsonl cmd/wof-as-jsonl/main.go
#11 72.42 go: downloading github.com/whosonfirst/go-writer-jsonl v0.0.1
#11 72.92 go build -o bin/wof-rename-property cmd/wof-rename-property/main.go
#11 73.38 go build -o bin/wof-remove-properties cmd/wof-remove-properties/main.go
#11 73.88 go build -o bin/wof-clone-feature cmd/wof-clone-feature/main.go
#11 DONE 74.5s
thisisaaronland commented 2 years ago

Right, the point of the vendor directory is to not have to download anything from the internet. It also make debugging and development easier since vendor-ed dependencies can be tweaked directly, when necessary.