grafeas / voucher

🎟 Voucher creates attestations for Binary Authorization
Apache License 2.0
73 stars 20 forks source link

v2 go.mod #30

Closed thepwagner closed 3 years ago

thepwagner commented 3 years ago

https://github.com/grafeas/voucher/pull/27 pushed code into the v2 subdirectory to be a v2 go module.

I think it skipped the important steps:

$ cp go.mod v2/go.mod
$ go mod edit -module github.com/grafeas/voucher/v2 v2/go.mod

Which results in the module not being usable:

$ cat go.mod && echo && go get
module voucher-test
require github.com/grafeas/voucher v2.5.3

go: errors parsing go.mod:
/Users/pwagner/tmp/voucher-test/go.mod:2: require github.com/grafeas/voucher: version "v2.5.3" invalid: should be v0 or v1, not v2
$ cat go.mod && echo && go get
module voucher-test
require github.com/grafeas/voucher/v2 v2.5.3

go: github.com/grafeas/voucher/v2@v2.5.3: go.mod has non-.../v2 module path "github.com/grafeas/voucher" (and .../v2/go.mod does not exist) at revision v2.5.3

This PR performs the copy. ~The go.mod left in the root might not be useful - I was afraid of breaking existing customers.~ I removed the go.mod in the root as cruft. The change can be verified without publishing using a local replacement directive:

$ cat go.mod && echo && go build github.com/grafeas/voucher/v2/cmd/voucher_server && ./voucher_server --version
module voucher-test
go 1.16
require github.com/grafeas/voucher/v2 v2.5.3
replace github.com/grafeas/voucher/v2 => ../voucher/v2

server version dev
google-cla[bot] commented 3 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

google-cla[bot] commented 3 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

thepwagner commented 3 years ago

@googlebot I signed it!

ooq commented 3 years ago

Thanks for the fix!