Comments (4)
It sounds ok to me. Let's consider if there's a better API. How about making the context exported? This allows for the above functionality without a getter function (which I favor). However it does expose this, so it can be changed (which could cause problems, but we can document that and don't have to make guarantees). Are there any downsides to that?
from goon.
Yeah I was wondering about making the Context public, so changing the Goon definition to:
type Goon struct {
Context appengine.Context
...
}
But my concern as well was people being able to mess with the Context, which concerned me, hence my use of the getter.
That's the only issue I had. But yeah, if we document it, I'm not seeing a huge issue.
from goon.
Considering that this is legal (although it panics):
package main
import "net/http"
func main() {
http.DefaultClient = nil
http.Get("http://google.com")
}
it seems that the Go style is accessor methods aren't worth it because the programmer is already supposed to know what to do. Unless other evidence is presented, I'm in favor of exporting it.
from goon.
👍 Agreed. I'll get hacking on it, should be an easy change.
from goon.
Related Issues (20)
- laterGet and laterPut HOT 5
- Consistency issue using aetest HOT 10
- Documentation appstats usage HOT 2
- Adding a Put to memory only call HOT 3
- Add support for google.golang.org/appengine packages HOT 18
- Can code depending on goon be unit tested without devserver? HOT 2
- Changes by PropertyLoadSaver.Load aren't cached. HOT 5
- Using context.Context in place of *http.Request HOT 5
- Use FromGoon in docs
- What's license? HOT 2
- TestEmbeddedStruct fails HOT 2
- GetMulti and Get don't ignore field mismatch in Tx HOT 2
- Failed to decode field config - extra data in buffer HOT 3
- Make compatible with cloud.google.com/go HOT 9
- Why the name `goon`? HOT 2
- Reusing entity cause slice values to be appended HOT 2
- Request: Add release tag for go modules HOT 3
- Surface a way to know the final cache key of entities. HOT 3
- Adding a property to an entity HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goon.