Skip to content

Commit

Permalink
added go mod
Browse files Browse the repository at this point in the history
  • Loading branch information
yakuter committed Nov 15, 2020
1 parent 5872601 commit 9115c48
Show file tree
Hide file tree
Showing 6 changed files with 370 additions and 9 deletions.
4 changes: 2 additions & 2 deletions controller/post-controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"log"

"ugin/model"
"ugin/pkg/database"
"github.com/yakuter/ugin/model"
"github.com/yakuter/ugin/pkg/database"

"github.com/gin-gonic/gin"
"github.com/jinzhu/gorm"
Expand Down
10 changes: 10 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module github.com/yakuter/ugin

go 1.15

require (
github.com/gin-gonic/gin v1.6.3
github.com/jinzhu/gorm v1.9.16
github.com/spf13/viper v1.7.1
github.com/stretchr/testify v1.6.1
)
348 changes: 348 additions & 0 deletions go.sum

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package main

import (
"ugin/pkg/config"
"ugin/pkg/database"
"ugin/pkg/router"
"log"

"github.com/yakuter/ugin/pkg/config"
"github.com/yakuter/ugin/pkg/database"
"github.com/yakuter/ugin/pkg/router"
)

func init() {
Expand All @@ -15,5 +17,6 @@ func main() {
config := config.GetConfig()

r := router.Setup()
log.Printf("Server is starting at 127.0.0.1:%s", config.Server.Port)
r.Run("127.0.0.1:" + config.Server.Port)
}
4 changes: 2 additions & 2 deletions pkg/database/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package database

import (
"fmt"
"ugin/model"
"ugin/pkg/config"
"github.com/yakuter/ugin/model"
"github.com/yakuter/ugin/pkg/config"

"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/mysql"
Expand Down
4 changes: 2 additions & 2 deletions pkg/router/router.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package router

import (
"ugin/controller"
"ugin/pkg/middleware"
"github.com/yakuter/ugin/controller"
"github.com/yakuter/ugin/pkg/middleware"

"github.com/gin-gonic/gin"
)
Expand Down

0 comments on commit 9115c48

Please sign in to comment.