Skip to content

xushuhui/goal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

goal

go web framework

Installation

go get github.com/xushuhui/goal

Example

package main

import (
    "net/http"
    "github.com/xushuhui/goal"
 
)

func main() {
	r := goal.Default()

	r.GET("/", func(c *Context) error {
		c.HTML(http.StatusOK, "<h1>Hello World</h1>")
		return nil
	})
	r.GET("/hello", func(c *Context) error {

		c.String(http.StatusOK, "hello %s, you're at %s\n", c.Query("name"), c.Path)
		return nil
	})
    r.Run(":8000")
}

RoadMap

  • bind
  • logging

微信公众号

扫码关注