8000 Merge pull request #3 from rjz/fix/readme-highlighting · rjz/githubhook@6ab7c67 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6ab7c67

Browse files
committed
Merge pull request #3 from rjz/fix/readme-highlighting
Highlights README syntax
2 parents 9299dde + 5887ea7 commit 6ab7c67

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,29 @@ be integrated with one.
77
Installation
88
-----------------------------------------------
99

10-
$ go get github.com/rjz/githubhook
10+
```ShellSession
11+
$ go get github.com/rjz/githubhook
12+
```
1113

1214
Usage
1315
-----------------------------------------------
1416

1517
Given an incoming `*http.Request` representing a webhook signed with a `secret`,
1618
use `githubhook` to validate and parse its content:
1719

18-
secret := []byte("don't tell!")
19-
hook, err := githubhook.Parse(secret, req)
20+
```go
21+
secret := []byte("don't tell!")
22+
hook, err := githubhook.Parse(secret, req)
23+
```
2024

2125
Plays nicely with the [google/go-github][gh-go-github] client!
2226

23-
evt := github.PullRequestEvent{}
24-
if err := json.Unmarshal(hook.Payload, &evt); err != nil {
25-
fmt.Println("Invalid JSON?", err)
26-
}
27+
```go
28+
evt := github.PullRequestEvent{}
29+
if err := json.Unmarshal(hook.Payload, &evt); err != nil {
30+
fmt.Println("Invalid JSON?", err)
31+
}
32+
```
2733

2834
[gh-webhook]: https://developer.github.com/webhooks/
2935
[gh-go-github]: https://github.com/google/go-github

0 commit comments

Comments
 (0)
0