Skip to content

Commit

Permalink
feat: resolved conflicts with main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
SudoSurya committed Nov 5, 2023
1 parent f29bc17 commit 81ec1f5
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions cmd/program/program.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type Project struct {
}

type Framework struct {
packageName string
packageName []string
templater Templater
}

Expand All @@ -30,12 +30,13 @@ type Templater interface {
Routes() []byte
}

const (
chiPackage = "github.com/go-chi/chi/v5"
gorillaPackage = "github.com/gorilla/mux"
routerPackage = "github.com/julienschmidt/httprouter"
ginPackage = "github.com/gin-gonic/gin"
fiberPackage = "github.com/gofiber/fiber/v2"
var (
chiPackage = []string{"github.com/go-chi/chi/v5"}
gorillaPackage = []string{"github.com/gorilla/mux"}
routerPackage = []string{"github.com/julienschmidt/httprouter"}
ginPackage = []string{"github.com/gin-gonic/gin"}
fiberPackage = []string{"github.com/gofiber/fiber/v2"}
echoPackage = []string{"github.com/labstack/echo/v4", "github.com/labstack/echo/v4/middleware"}

cmdApiPath = "cmd/api"
internalServerPath = "internal/server"
Expand All @@ -50,14 +51,13 @@ func (p *Project) ExitCLI(tprogram *tea.Program) {
}

func (p *Project) createFrameworkMap() {

p.FrameworkMap["chi"] = Framework{
packageName: chiPackage,
templater: tpl.ChiTemplates{},
}

p.FrameworkMap["standard library"] = Framework{
packageName: "",
packageName: []string{},
templater: tpl.StandardLibTemplate{},
}

Expand All @@ -80,6 +80,11 @@ func (p *Project) createFrameworkMap() {
packageName: routerPackage,
templater: tpl.RouterTemplates{},
}

p.FrameworkMap["echo"] = Framework{
packageName: echoPackage,
templater: tpl.EchoTemplates{},
}
}

func (p *Project) CreateMainFile() error {
Expand Down Expand Up @@ -193,6 +198,12 @@ func (p *Project) CreateMainFile() error {
if err != nil {
return err
}
err = utils.GoFmt(projectPath)
if err != nil {
log.Printf("Could not gofmt in new project %v\n", err)
cobra.CheckErr(err)
}

return nil
}

Expand Down

0 comments on commit 81ec1f5

Please sign in to comment.