-
Notifications
You must be signed in to change notification settings - Fork 48
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
SDK selection refactor #197
Conversation
151eb52
to
d262891
Compare
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.
Thanks for this refactoring effort, many places required cleaning up. In general feels like it's more maintainable now.
r.Use(methodTimer) | ||
|
||
r.HandleFunc("/", Index) | ||
r.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) { |
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.
Maybe it's just me, but I like to keep any views logic, no matter how trivial, in the handlers
source file to minimize surprises in code discovery.
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.
what do you mean surprises in code discovery?
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.
The kind of surprise when you read through handlers.go
and realize that some of the handlers logic is actually in routes.go
Coverage decreased (-1.1%) to 63.347% though |
a lot of unused functions in config.go. can i delete them? |
I think they're mostly from player code so yes. |
@@ -37,21 +36,21 @@ func init() { | |||
Config = GetConfig() | |||
} | |||
|
|||
func GetConfig() *ConfigWrapper { | |||
func GetConfig() *configWrapper { |
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.
Returning variables of private types from public functions is not a recommended practice
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.
can you link me to where this is not recommended? i see this in plenty of places and it makes sense to me
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.
I learned this from golint and their reasoning seems compelling, namely:
can't put a *sample field in their own struct
Even in my not-so-long practice I distinctly remember being annoyed by this more than a few times.
4d95fef
to
b5e8e86
Compare
b5e8e86
to
601d8e2
Compare
here's how I want to make wallet selection work:
i'm planning to drop the wallet_id column in the db, and most references to wallet ids in the code. sdk assignment will be done off user ids, and anytime wallet ids are needed, they'll just be generated from a template (right now that's
lbrytv-id.ID.wallet
)other changes i made:
This is a continuation of the work in #195