Skip to content
This repository has been archived by the owner on Jan 18, 2025. It is now read-only.

Add database Dial example #50

Merged

Conversation

ernestas-poskus
Copy link
Contributor

#31

@dennwc @theduke

Adding Dial example

@ernestas-poskus ernestas-poskus force-pushed the features/add_database_dial_example branch 5 times, most recently from e372cdd to f944d74 Compare December 26, 2015 21:25
@dennwc
Copy link
Collaborator

dennwc commented Dec 26, 2015

  1. Import path should be gopkg.in/istreamdata/orientgo.v2/obinary.

  2. I think we can make a Dial example much shorter for README - only the necessary lines. Everything else will be visible via godoc.

  3. Examples can be built into test files. They will be tested for compilation automatically and will appear in godoc in a natural way. So please change everything accordingly to "Large examples" section of documentation.

@ernestas-poskus ernestas-poskus force-pushed the features/add_database_dial_example branch 3 times, most recently from 5318ead to 5f43949 Compare December 27, 2015 16:45
@ernestas-poskus
Copy link
Contributor Author

I think we can make a Dial example much shorter for README - only the necessary lines. Everything else will be visible via godoc.

made it a little shorter

  1. Examples can be built into test files. They will be tested for compilation automatically and will appear in godoc in a natural way. So please change everything accordingly to "Large examples" section of documentation.

then example will be non-copy-able, I mean user will have to figure out import paths.

How about I will add just a link to examples folder ?

@ernestas-poskus ernestas-poskus force-pushed the features/add_database_dial_example branch 3 times, most recently from d8bc50a to d9b48ad Compare December 27, 2015 16:52
@dennwc
Copy link
Collaborator

dennwc commented Dec 27, 2015

I still think it's too large for README. Example code is good itself, but not for the project main page. Would you mind leaving something like Dial-Open-SQLQuery for README without any details at all? You can even drop error handling there.

then example will be non-copy-able, I mean user will have to figure out import paths.

You can use full import paths in example by naming it package orient_test. Please check this example. It's a copy-able code with full godoc support. You can't underestimate how useful such examples could be - anyone can see it right after function documentation :)

Also, please remove HandleError wrapper. Panics are ok for examples.

@ernestas-poskus ernestas-poskus force-pushed the features/add_database_dial_example branch 3 times, most recently from a92111f to ef6d462 Compare December 28, 2015 20:14
@ernestas-poskus ernestas-poskus force-pushed the features/add_database_dial_example branch 2 times, most recently from 1eefb6a to b70a597 Compare January 6, 2016 18:28
@ernestas-poskus ernestas-poskus force-pushed the features/add_database_dial_example branch from b70a597 to 1b2e521 Compare January 6, 2016 18:29
@ernestas-poskus
Copy link
Contributor Author

Updated README with file reference, added example to root of the package.

@dennwc
Copy link
Collaborator

dennwc commented Jan 6, 2016

Looks great! Thank you for you work :)

dennwc added a commit that referenced this pull request Jan 6, 2016
@dennwc dennwc merged commit 3693ebe into istreamdata:v2 Jan 6, 2016
@ernestas-poskus ernestas-poskus deleted the features/add_database_dial_example branch January 6, 2016 21:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants