-
Notifications
You must be signed in to change notification settings - Fork 1
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
my attempt #5
base: master
Are you sure you want to change the base?
my attempt #5
Conversation
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.
noice
return nil, err | ||
} else if book == nil { | ||
w.WriteHeader(http.StatusNotFound) | ||
return nil, nil |
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.
if book is nil, return an err, not nil, nil. From what i've seen in go, returning nil objects isn't a convention. Better to return a not found err and let the next level up decide what to do with it
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.
its a slightly old post, but i think the convention holds (https://go.dev/blog/go1.13-errors)
@@ -9,4 +9,4 @@ services: | |||
ports: | |||
- "3031:3031" | |||
volumes: | |||
- "~/.config/gcloud/emulators/datastore/:/opt/data" | |||
- "~/.config/gcloud/emulators/store/:/opt/data" |
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.
is this a change that we need to make to master? or was it a local config thing?
} | ||
it := client.Run(ctx, query) | ||
for { | ||
var itemProperties datastore.PropertyList |
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.
:nit May only be a github formatting thing, but we should get in the habit of doing go fmt as a part of the save/commit cycle. Should avoid slightly odd indentation, and does things like realigning the structs to a standard convention
return update("Book", book.Id, book) | ||
} | ||
|
||
func createBookFromProperties(properties []datastore.Property) (Book, 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.
is this your version of generics!!
No description provided.