-
Notifications
You must be signed in to change notification settings - Fork 58
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
Updated the README to show a working example for the latest version (Closes #52) #53
Conversation
Codecov Report
@@ Coverage Diff @@
## master #53 +/- ##
=======================================
Coverage 38.25% 38.25%
=======================================
Files 7 7
Lines 677 677
=======================================
Hits 259 259
Misses 395 395
Partials 23 23 Continue to review full report at Codecov.
|
LGTM 👍 |
import luno "github.com/luno/luno-go" | ||
import ( |
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.
Suggest combining the imports:
import (
"log"
"context"
"time"
"github.com/luno/luno-go"
)
README.md
Outdated
"log" | ||
"context" | ||
"time" | ||
) | ||
|
||
lunoClient := luno.NewClient() |
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.
While you're at it, would you mind putting this in a func main() { }
?
README.md
Outdated
if err != nil { | ||
log.Fatal(err) | ||
} | ||
log.Println(res) | ||
``` | ||
|
||
Remember to substitute `<API_KEY_ID>` and `<API_KEY_SECRET>` for your own Id and Secret. |
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.
nipick: lowercase id + secret
README.md
Outdated
And then access them in Go like so: | ||
|
||
```go | ||
|
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.
nitpick: remove empty line
README.md
Outdated
|
||
var API_KEY_ID string = os.Getenv("LUNO_API_ID") | ||
var API_KEY_SECRET string = os.Getenv("LUNO_API_SECRET") | ||
|
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.
nitpick: remove empty line
var API_KEY_SECRET string = os.Getenv("LUNO_API_SECRET") | ||
|
||
``` | ||
|
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.
nitpick: remove two empty lines
README.md
Outdated
if err != nil { | ||
log.Fatal(err) | ||
} | ||
log.Println(res) | ||
``` | ||
|
||
Remember to substitute `<API_KEY_ID>` and `<API_KEY_SECRET>` for your own Id and Secret. | ||
|
||
It is also recommended to set these as environment variables rather than include them in plaintext. You can do this on `BASH` with: |
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.
Suggest: We recommend using environment variables rather than including your credentials in plaintext. In bash you do so as follows:
README.md
Outdated
It is also recommended to set these as environment variables rather than include them in plaintext. You can do this on `BASH` with: | ||
|
||
``` | ||
$ set LUNO_API_ID="<API_KEY_ID>" |
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.
set -> export
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.
Yeah this one was a brain fart on my end...
@neilgarb Should be good now |
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.
Great stuff, thanks!
The README hadn't been updated for over a year.
Hence, the example provided does not actually work with the most recent version of the library.
I updated the README to show a full working example compatible with the most recent version of the library, which requires
Context
to be passed to the methods ofClient
.