-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: make metadata.FromContext work again (#103)
FF Go used to have a dependency on the "cloud.google.com/go/functions/metadata" package, which defined an unexported context key and used it to add a value to the context. This is the recommended way to add values to a context using [WithValue](https://pkg.go.dev/context#WithValue). FF Go has to continue using the `metadata.NewContext` call from "cloud.google.com/go/functions/metadata" to have `metadata.FromContext` from the same package work in customer's function code. This is due to the fact that Golang purposely differentiates context keys from different packages as different keys to prevent collisions, even if the keys have the same string-name. In the future, FF Go can move onto using its own `metadata` package to avoid pulling in all the dependencies of "cloud.google.com/go/functions/metadata", which contains other unrelated GCF client code too. But it will have to be done with a breaking change major version update.
- Loading branch information
Showing
10 changed files
with
532 additions
and
331 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters