-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
46 lines (40 loc) · 812 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package main
import (
"flag"
"fmt"
)
const (
ECHO = "echo"
GOJI = "goji"
GIN = "gin"
BEEGO = "beego"
GOCHI = "gochi"
)
var frameworks = map[string]string{
"github.com/labstack/echo/v4": ECHO,
"github.com/labstack/echo": ECHO,
"goji.io": GOJI,
"github.com/gin-gonic/gin": GIN,
"github.com/beego/beego/v2": BEEGO,
"github.com/go-chi/chi/v5": GOCHI,
}
func main() {
var goModFile string
flag.StringVar(&goModFile, "go-mod-file", "go.mod", "specify the path of the go.mod file")
flag.Parse()
require, err := parsePackages(goModFile)
if err != nil {
return
}
framework := getFramework(require)
switch framework {
case ECHO:
echo()
case GOJI:
goji()
case BEEGO:
case GOCHI:
default:
fmt.Printf("framework not supported: %s\n", framework)
}
}