初步搭建02
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"github.com/labstack/echo"
|
||||
@@ -10,15 +9,8 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
client := common.GetDataBaseClient()
|
||||
|
||||
config, ero := client.DB()
|
||||
if ero != nil {
|
||||
fmt.Println("获取连接池失败")
|
||||
panic(ero)
|
||||
}
|
||||
|
||||
defer config.Close()
|
||||
client, close := common.GetDataBaseClient()
|
||||
defer close()
|
||||
app := echo.New()
|
||||
app.GET("/", func(ctx echo.Context) error {
|
||||
return ctx.String(http.StatusOK, "Hello, World!")
|
||||
|
||||
Reference in New Issue
Block a user