qit-team / snow Goto Github PK
View Code? Open in Web Editor NEW简洁易用的Go业务框架
License: MIT License
简洁易用的Go业务框架
License: MIT License
go report 显示这个项目代码质量是 B,而 gin 是 A
https://goreportcard.com/report/github.com/qit-team/snow
有windows下编译的方法吗?我自己尝试了好几次都编译不成功
go/src/snow-demo$ ./build/bin/snow
[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.
[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
- using env: export GIN_MODE=release
- using code: gin.SetMode(gin.ReleaseMode)
[GIN-debug] GET /hello --> snow-demo/app/http/controllers.HandleHello (7 handlers)
[GIN-debug] POST /test --> snow-demo/app/http/controllers.HandleTest (7 handlers)
curl "http://127.0.0.1:8000/hello"
curl: (7) Failed to connect to 127.0.0.1 port 8000: Connection refused
curl "http://127.0.0.1:8080/hello"
{"code":200,"data":"hello world!","message":"ok","request_uri":"/hello"}
搜了下代码,7月3号在用8000,9月8号在用8080,打算用哪个呢?gin官方是用8080,既然是基于gin的,建议保持一致。
安装文档wiki中 https://github.com/qit-team/snow/wiki/install 中下载源码包步骤
git clone [email protected]/qit-team/snow.git my-project
执行上面的命令会提示fatal: 仓库 '[email protected]/qit-team/snow.git' 不存在
需要更新为:
git clone [email protected]:qit-team/snow.git my-project
cd $GOPATH/src
# 进入新项目的仓库地址+空间目录
cd my-github/my-space
# 下载源码包,保存为新项目名
git clone [email protected]:qit-team/snow.git my-project
# 进入项目根目录
cd my-project
# 替换为新项目的包命名空间
sh build/shell/replace.sh my-github/my-space/my-project
# 复制样例环境配置为当前环境配置
cp .env.example .env
当走到 sh build/shell/replace.sh my-github/my-space/my-project
这一步的时候, 会报如下错误!!
sed:无法读取 s|github.com/qit-team/snow|my-github/my-space/my-project|:没有那个文件或目录
从如上理解:sed是替换的意思,大致是将github.com/qit-team/snow替换成my-github/my-space/my-project
先抛开问题,咱们看一下build/shell/replace.sh
这个文件。
#/bin/bash
# 将项目的包命名空间统一替换成目标目录空间
target=$1
default="github.com/qit-team/snow"
if [ "$target" == "" ]; then
target="$default"
fi
#回到根目录
rootPath=$(cd `dirname $0`/../../; pwd)
#替换
find . -type f -name "*.*" ! -path "./vendor/*" ! -path "./logs/*" ! -path "./docs/*" ! -path "./.git/*" ! -path "./build/shell/replace.sh" | xargs sed -i "" "s|${default}|${target}|"
从上面的文件我们能得出几点
====
总之在当走到 sh build/shell/replace.sh my-github/my-space/my-project
这一步的时候, 会报如下错误!!还请抽空帮看下,感谢!!
作为正式可上线的框架,应带着完善的 tests 代码。通过 https://codecov.io 可显示测试覆盖率。
可以媲美,php中的thinkphp和java 的ssh
➜ ~ go get github.com/qit-team/snow/tool/snow
报错如下:
# github.com/qit-team/snow/tool/snow
go/src/github.com/qit-team/snow/tool/snow/main.go:14:15: cannot use []cli.Command literal (type []cli.Command) as type []*cli.Command in assignment
go/src/github.com/qit-team/snow/tool/snow/main.go:20:19: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
go/src/github.com/qit-team/snow/tool/snow/main.go:26:19: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
go/src/github.com/qit-team/snow/tool/snow/main.go:39:19: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
go/src/github.com/qit-team/snow/tool/snow/main.go:45:19: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
go/src/github.com/qit-team/snow/tool/snow/main.go:51:19: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
go/src/github.com/qit-team/snow/tool/snow/main.go:57:19: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
go/src/github.com/qit-team/snow/tool/snow/main.go:63:19: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
go/src/github.com/qit-team/snow/tool/snow/main.go:92:19: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
go/src/github.com/qit-team/snow/tool/snow/model.go:86:8: invalid argument ctx.Args() (type cli.Args) for len
go/src/github.com/qit-team/snow/tool/snow/model.go:86:8: too many errors
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.