-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix Go 1.10 build errors #863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
All the cool kids are doing, we maybe should, too.
Fixes darwin/cgo errors in Go 1.10
LGTM |
|
||
} | ||
|
||
// NewBundlerFromPEM creates a new Bundler from PEM-encoded root certificates and | ||
// intermediate certificates. | ||
// If caBundlePEM is nil, the resulting Bundler can only do "Force" bundle. | ||
func NewBundlerFromPEM(caBundlePEM, intBundlePEM []byte) (*Bundler, error) { | ||
func NewBundlerFromPEM(caBundlePEM, intBundlePEM []byte, opt ...Option) (*Bundler, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure about the semantic of a list of opt functions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is emerging as a common pattern for initializers in Go. Some background: https://dave.cheney.net/2014/10/17/functional-options-for-friendly-apis.
And my implementation was inspired (read: mostly copied) from gRPC: https://github.com/grpc/grpc-go/blob/583a6303969ea5075e9bd1dc4b75805dfe66989a/server.go#L328.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool, I learn something new!
The bundler related build failures are surprising to me, as the tests pass locally and some of them passed on Travis. I'm going to close and re-open this PR to trigger another Travis build. |
Oh, duh. Of course this fixes the Go 1.10 builds but breaks the other versions. |
As of Go 1.10 Certificate.Verify will check the allowed key usages for the entire chain: https://golang.org/doc/go1.10#crypto/x509
Ok, all the tests pass now (with the exception of the flapping macOS one). |
This is the first released version containing the change required in cloudflare#863 Added benefit: github.com/gogo/protobuf is not needed anymore.
Fixes #857 and #861.
Also includes switching to
dep
for dependency management.