* remove golang.org/x/net dependency
The golang.org/x/net/context package is an alias for stdlib context
since go1.7 (see https://go-review.googlesource.com/72570)
This patch replaces all uses of it for stdlib context.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* rename App Engine context type to remove import aliases
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
---------
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This causes Call to apply Namespace at the very beginning of the
Call chain.
This prevents an issue where some appserver APIs treat NameSpace=nil
and NameSpace="" distinctly (with the latter being an error). Now if
the namespace is unset or set to "" in the SDK, no namespace will be
applied to the outgoing message.
This also implements a very basic ContextForTesting for classic
testing.
Change-Id: I0c5c2917d958920ab015b8cf7f6b34a2a1b8d2a0
Most well-formed application code will require minimal changes:
- The type is now golang.org/x/net/context.(*Context).
- c := appengine.NewContext(r) still works.
- Most API calls still look exactly the same.
- Logging now uses the google.golang.org/appengine/log package.
Change-Id: I7fa089efa8d0b1e7beeeb6233a98fe054020b1fc
Previously if you have a context c,
and wrap it in a namespace "A" to give nc,
and wrap *that* in the empty namespace "" (to get back to root) to give c0,
then API calls made against c0 would be incorrectly namespaced,
because the namespace mods would not be applied with the empty namespace
(a trivial and ultimately buggy optimisation), and would therefore pass
the API call on to nc, which would apply namespace "A".
The fix here is to always apply namespace modifications in namespacedContext,
even if the namespace is empty.
Change-Id: Ieaf5c67e869d2cc9b619b922907d5c5fffde2643