Skip to content

Commit ae13a42

Browse files
v1.0.0 chore: update README.md 52c3fcb
1 parent 76b8a5b commit ae13a42

File tree

6 files changed

+323
-339
lines changed

6 files changed

+323
-339
lines changed

example/defer/defer.go

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
package main
22
import "fmt"
33
func main() {
4-
// 2. 在输出 world
5-
defer fmt.Println("world")
6-
// 1. 先输出 hello
7-
fmt.Println("hello")
8-
// 输出结果
9-
// =======
10-
// hello
11-
// world
4+
// 2. 在输出 world
5+
defer fmt.Println("world")
6+
// 1. 先输出 hello
7+
fmt.Println("hello")
8+
// 输出结果
9+
// =======
10+
// hello
11+
// world
1212

1313

14-
fmt.Println("counting")
15-
for i := 0; i < 10; i++ {
16-
defer fmt.Println(i)
17-
}
18-
fmt.Println("done")
19-
// 输出结果
20-
// =======
21-
// counting
22-
// done
23-
// 9
24-
// 8
25-
// 7
26-
// 6
27-
// 5
28-
// 4
29-
// 3
30-
// 2
31-
// 1
32-
// 0
14+
fmt.Println("counting")
15+
for i := 0; i < 10; i++ {
16+
defer fmt.Println(i)
17+
}
18+
fmt.Println("done")
19+
// 输出结果
20+
// =======
21+
// counting
22+
// done
23+
// 9
24+
// 8
25+
// 7
26+
// 6
27+
// 5
28+
// 4
29+
// 3
30+
// 2
31+
// 1
32+
// 0
3333
}

example/example/defer/defer.go

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
package main
22
import "fmt"
33
func main() {
4-
// 2. 在输出 world
5-
defer fmt.Println("world")
6-
// 1. 先输出 hello
7-
fmt.Println("hello")
8-
// 输出结果
9-
// =======
10-
// hello
11-
// world
4+
// 2. 在输出 world
5+
defer fmt.Println("world")
6+
// 1. 先输出 hello
7+
fmt.Println("hello")
8+
// 输出结果
9+
// =======
10+
// hello
11+
// world
1212

1313

14-
fmt.Println("counting")
15-
for i := 0; i < 10; i++ {
16-
defer fmt.Println(i)
17-
}
18-
fmt.Println("done")
19-
// 输出结果
20-
// =======
21-
// counting
22-
// done
23-
// 9
24-
// 8
25-
// 7
26-
// 6
27-
// 5
28-
// 4
29-
// 3
30-
// 2
31-
// 1
32-
// 0
14+
fmt.Println("counting")
15+
for i := 0; i < 10; i++ {
16+
defer fmt.Println(i)
17+
}
18+
fmt.Println("done")
19+
// 输出结果
20+
// =======
21+
// counting
22+
// done
23+
// 9
24+
// 8
25+
// 7
26+
// 6
27+
// 5
28+
// 4
29+
// 3
30+
// 2
31+
// 1
32+
// 0
3333
}

example/example/module/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,18 @@ go help mod
4444

4545
Usage:
4646

47-
go mod <command> [arguments]
47+
go mod <command> [arguments]
4848

4949
The commands are:
5050

51-
download download modules to local cache
52-
edit edit go.mod from tools or scripts
53-
graph print module requirement graph
54-
init initialize new module in current directory
55-
tidy add missing and remove unused modules
56-
vendor make vendored copy of dependencies
57-
verify verify dependencies have expected content
58-
why explain why packages or modules are needed
51+
download download modules to local cache
52+
edit edit go.mod from tools or scripts
53+
graph print module requirement graph
54+
init initialize new module in current directory
55+
tidy add missing and remove unused modules
56+
vendor make vendored copy of dependencies
57+
verify verify dependencies have expected content
58+
why explain why packages or modules are needed
5959

6060
Use "go help mod <command>" for more information about a command.
6161
```

example/example/module/go.mod

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,36 @@ module mod2
33
go 1.17
44

55
require (
6-
github.com/gin-contrib/sse v0.1.0 // indirect
7-
github.com/gin-gonic/gin v1.7.7
8-
github.com/golang/protobuf v1.3.3 // indirect
9-
github.com/json-iterator/go v1.1.9 // indirect
10-
github.com/mattn/go-isatty v0.0.12 // indirect
11-
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
12-
github.com/modern-go/reflect2 v1.0.1 // indirect
13-
github.com/stretchr/testify v1.4.0 // indirect
14-
github.com/ugorji/go/codec v1.1.7 // indirect
15-
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 // indirect
16-
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 // indirect
17-
golang.org/x/sys v0.0.0-20200116001909-b77594299b42 // indirect
18-
gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
19-
gopkg.in/go-playground/validator.v8 v8.18.2 // indirect
20-
gopkg.in/yaml.v2 v2.2.8 // indirect
6+
github.com/gin-contrib/sse v0.1.0 // indirect
7+
github.com/gin-gonic/gin v1.7.7
8+
github.com/golang/protobuf v1.3.3 // indirect
9+
github.com/json-iterator/go v1.1.9 // indirect
10+
github.com/mattn/go-isatty v0.0.12 // indirect
11+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
12+
github.com/modern-go/reflect2 v1.0.1 // indirect
13+
github.com/stretchr/testify v1.4.0 // indirect
14+
github.com/ugorji/go/codec v1.1.7 // indirect
15+
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 // indirect
16+
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 // indirect
17+
golang.org/x/sys v0.0.0-20200116001909-b77594299b42 // indirect
18+
gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
19+
gopkg.in/go-playground/validator.v8 v8.18.2 // indirect
20+
gopkg.in/yaml.v2 v2.2.8 // indirect
2121
)
2222

2323
require (
24-
github.com/davecgh/go-spew v1.1.1 // indirect
25-
github.com/go-playground/assert/v2 v2.0.1 // indirect
26-
github.com/go-playground/locales v0.13.0 // indirect
27-
github.com/go-playground/universal-translator v0.17.0 // indirect
28-
github.com/go-playground/validator/v10 v10.4.1 // indirect
29-
github.com/google/gofuzz v1.0.0 // indirect
30-
github.com/leodido/go-urn v1.2.0 // indirect
31-
github.com/pmezard/go-difflib v1.0.0 // indirect
32-
github.com/stretchr/objx v0.1.0 // indirect
33-
github.com/ugorji/go v1.1.7 // indirect
34-
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 // indirect
35-
golang.org/x/text v0.3.2 // indirect
36-
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e // indirect
37-
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 // indirect
24+
github.com/davecgh/go-spew v1.1.1 // indirect
25+
github.com/go-playground/assert/v2 v2.0.1 // indirect
26+
github.com/go-playground/locales v0.13.0 // indirect
27+
github.com/go-playground/universal-translator v0.17.0 // indirect
28+
github.com/go-playground/validator/v10 v10.4.1 // indirect
29+
github.com/google/gofuzz v1.0.0 // indirect
30+
github.com/leodido/go-urn v1.2.0 // indirect
31+
github.com/pmezard/go-difflib v1.0.0 // indirect
32+
github.com/stretchr/objx v0.1.0 // indirect
33+
github.com/ugorji/go v1.1.7 // indirect
34+
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 // indirect
35+
golang.org/x/text v0.3.2 // indirect
36+
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e // indirect
37+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 // indirect
3838
)

example/example/module/main.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ package main
22

33

44
import (
5-
"html/template"
6-
"log"
7-
"os"
8-
"github.com/gin-gonic/gin"
5+
"html/template"
6+
"log"
7+
"os"
8+
"github.com/gin-gonic/gin"
99
)
1010

1111
var html = template.Must(template.New("https").Parse(`
@@ -21,18 +21,18 @@ var html = template.Must(template.New("https").Parse(`
2121

2222

2323
func main() {
24-
logger := log.New(os.Stderr, "", 0)
25-
logger.Println("[WARNING] DON'T USE THE EMBED CERTS FROM THIS EXAMPLE IN PRODUCTION ENVIRONMENT, GENERATE YOUR OWN!")
24+
logger := log.New(os.Stderr, "", 0)
25+
logger.Println("[WARNING] DON'T USE THE EMBED CERTS FROM THIS EXAMPLE IN PRODUCTION ENVIRONMENT, GENERATE YOUR OWN!")
2626

27-
r := gin.Default()
28-
r.SetHTMLTemplate(html)
27+
r := gin.Default()
28+
r.SetHTMLTemplate(html)
2929

30-
r.GET("/", func(c *gin.Context) {
31-
c.HTML(200, "https", gin.H{
32-
"status": "success",
33-
})
34-
})
30+
r.GET("/", func(c *gin.Context) {
31+
c.HTML(200, "https", gin.H{
32+
"status": "success",
33+
})
34+
})
3535

36-
// Listen and Server in https://127.0.0.1:8080
37-
r.Run(":8083")
36+
// Listen and Server in https://127.0.0.1:8080
37+
r.Run(":8083")
3838
}

0 commit comments

Comments
 (0)