Fix usage code in README.md skip ci
This commit is contained in:
parent
b1ec2978a2
commit
82ee148846
16
README.md
16
README.md
|
@ -8,12 +8,22 @@
|
|||
## Usage
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/mattn/go-mastodon"
|
||||
"log"
|
||||
)
|
||||
|
||||
func main() {
|
||||
c := mastodon.NewClient(&mastodon.Config{
|
||||
Server: "https://mstdn.jp",
|
||||
ClientID: "client-id",
|
||||
ClientSecret: "client-secret",
|
||||
})
|
||||
err := c.Authenticate("your-username", "your-password")
|
||||
err := c.Authenticate(context.Background(), "your-email", "your-password")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
@ -21,6 +31,10 @@ timeline, err := c.GetTimelineHome(context.Background())
|
|||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
for i := len(timeline) - 1; i >= 0; i-- {
|
||||
fmt.Println(timeline[i])
|
||||
}
|
||||
}
|
||||
```
|
||||
## Status of implementations
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user