Skip to content

Commit 5d1b16d

Browse files
committed
doc: Update use embedmd (include file in .md)
1 parent ebb0d39 commit 5d1b16d

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ install:
1111
- go get github.com/campoy/embedmd
1212

1313
script:
14-
- embedmd -d *.md
14+
- embedmd -w *.md
1515
- go test -v -covermode=atomic -coverprofile=coverage.out
1616

1717
after_success:

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@ import "github.com/gin-contrib/static"
2727

2828
See the [example](example)
2929

30-
[embedmd]:# (example/simple/example.go go)
31-
3230
#### Serve local file
31+
[embedmd]:# (example/simple/example.go)
3332
```go
3433
package main
3534

@@ -56,6 +55,7 @@ func main() {
5655
```
5756

5857
#### Serve embed folder
58+
[embedmd]:# (example/embed/example.go)
5959
```go
6060
package main
6161

@@ -68,20 +68,20 @@ import (
6868
"github.com/gin-gonic/gin"
6969
)
7070

71-
//go:embed tmp/server
71+
//go:embed data
7272
var server embed.FS
7373

7474
func main() {
7575
r := gin.Default()
76-
r.Use(static.Serve("/", static.EmbedFolder(server, "tmp/server")))
76+
r.Use(static.Serve("/", static.EmbedFolder(server, "data/server")))
7777
r.GET("/ping", func(c *gin.Context) {
7878
c.String(200, "test")
7979
})
80-
r.NoRoute(func (c *gin.Context) {
80+
r.NoRoute(func(c *gin.Context) {
8181
fmt.Printf("%s doesn't exists, redirect on /\n", c.Request.URL.Path)
8282
c.Redirect(http.StatusMovedPermanently, "/")
8383
})
8484
// Listen and Server in 0.0.0.0:8080
8585
r.Run(":8080")
8686
}
87-
```
87+
```

0 commit comments

Comments
 (0)