Skip to content

Commit

Permalink
example:update code and go.mod
Browse files Browse the repository at this point in the history
  • Loading branch information
alimy committed Jan 21, 2019
1 parent 23fc6ff commit 8c5e821
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions module/example/go.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module github.com/alimy/mir/module/example

require (
github.com/alimy/mir v0.5.1-0.20190119172507-476d88190b52
github.com/alimy/mir/module/gin v0.0.0-20190119173040-ab7801c02a7b
github.com/alimy/mir v0.5.2-0.20190121081835-6a12746c47e2
github.com/alimy/mir/module/gin v0.0.0-20190121083822-23fc6ffddb60
github.com/gin-gonic/gin v1.3.0
)
8 changes: 4 additions & 4 deletions module/example/go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
github.com/alimy/mir v0.5.1-0.20190119172507-476d88190b52 h1:RnFUqAvzDsWRW8pJ2FJiI4mkh9+RtPofUswYam2cUXI=
github.com/alimy/mir v0.5.1-0.20190119172507-476d88190b52/go.mod h1:JIZY+q16FJKFNm2/a9KgUmYpa6SpsT9i7hafdg7xBhQ=
github.com/alimy/mir/module/gin v0.0.0-20190119173040-ab7801c02a7b h1:5bw+J8gNeX3R32Mj+/6dr+g60pb4zsmnZl2cyLwMIH4=
github.com/alimy/mir/module/gin v0.0.0-20190119173040-ab7801c02a7b/go.mod h1:Ca00fJk4piLwAxA04EzRJtVGi+9qMvvSoSTgBj/O/Ig=
github.com/alimy/mir v0.5.2-0.20190121081835-6a12746c47e2 h1:GfHwqnMYxajPONV29l9j2Fak9AbOHRNP4v6njDwIKVE=
github.com/alimy/mir v0.5.2-0.20190121081835-6a12746c47e2/go.mod h1:JIZY+q16FJKFNm2/a9KgUmYpa6SpsT9i7hafdg7xBhQ=
github.com/alimy/mir/module/gin v0.0.0-20190121083822-23fc6ffddb60 h1:XUIfx9alxyyEogC7StQysbRL2QGfyOQSOFX0zcMDcL4=
github.com/alimy/mir/module/gin v0.0.0-20190121083822-23fc6ffddb60/go.mod h1:i13gk7/TNTi8g1iZXDftfCjT1Gl74nSwQe36LT0aoXg=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7 h1:AzN37oI0cOS+cougNAV9szl6CVoj2RYwzS3DpUQNtlY=
github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s=
Expand Down
8 changes: 4 additions & 4 deletions module/example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ type site struct {

// Index handler of the index field that in site struct, the struct tag indicate
// this handler will register to path "/index/" and method is http.MethodGet.
func (h *site) Index(context *gin.Context) {
context.String(http.StatusOK, "get index data")
func (s *site) Index(c *gin.Context) {
c.String(http.StatusOK, "Index")
}

// GetArticles handler of articles indicator that contains Host/Path/Queries/Handler info.
func (h *site) GetArticles(context *gin.Context) {
context.String(http.StatusOK, "get articles data")
func (s *site) GetArticles(c *gin.Context) {
c.String(http.StatusOK, "GetArticles:"+c.Param("category"))
}

func main() {
Expand Down

0 comments on commit 8c5e821

Please sign in to comment.