grafeas / voucher

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

golang-1.16 #39

Closed thepwagner closed 3 years ago

thepwagner commented 3 years ago

Update actions and Dockerfile to prefer go1.16.

In https://github.com/grafeas/voucher/pull/38/files#diff-faff1af3d8ff408964a57b2e475f69a6b7c7b71c9978cccc8f471798caac2c88R17 , I removed a leading carat that meant tests looked like they were being run with go1.14, when really go1.16.7 was being used: https://github.com/grafeas/voucher/runs/3505266908?check_suite_focus=true#step:2:10

Actually using go1.14 for testing breaks tests, which rely on t.TempDir() - which was added in go1.15 🤦

So this PR uses go1.16 in earnest, instead of relying on actions/setup-go's behaviour.


There's another lint issue that snuck through:

 Error: SA1019: package github.com/golang/protobuf/protoc-gen-go/generator is deprecated: Use the "google.golang.org/protobuf/compiler/protogen" package instead to write protoc plugins in Go.  (staticcheck)

Here, all we were using is the CamelCase() conversion function - I couldn't find it in the "new" library, so I've replaced the call with a purpose-built library. I didn't vet the library beyond confirming it has a compatible license and reading https://github.com/iancoleman/strcase/blob/master/camel.go