GithubHelp home page GithubHelp logo

snow's Issues

8000 端口无法访问

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的,建议保持一致。

image

image

sed:无法读取 s|github.com/qit-team/snow|my-github/my-space/my-project|:没有那个文件或目录

@hetiansu5

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}|"

从上面的文件我们能得出几点

  1. rootPath应该是没用吧?
  2. 先查满足规则的文件名(排除几个目录)
  3. 替换sed命令,我是centos,用s|old|new| 应该是不对吧?你的是mac?

====

总之在当走到 sh build/shell/replace.sh my-github/my-space/my-project 这一步的时候, 会报如下错误!!还请抽空帮看下,感谢!!

Go 1.14.2 macOS Catalina下面go get执行报错

~ 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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.