feat: rename module from tal-tech to zeromicro (#1413)

This commit is contained in:
Kevin Wan
2022-01-04 15:51:32 +08:00
committed by GitHub
parent e267d94ee1
commit a91c3907a8
277 changed files with 578 additions and 578 deletions

View File

@@ -21,7 +21,7 @@ const (
import (
"net/http"
{{if .After1_1_10}}"github.com/tal-tech/go-zero/rest/httpx"{{end}}
{{if .After1_1_10}}"github.com/zeromicro/go-zero/rest/httpx"{{end}}
{{.ImportPackages}}
)

View File

@@ -149,7 +149,7 @@ var commands = []cli.Command{
},
cli.StringFlag{
Name: "style",
Usage: "the file naming format, see [https://github.com/tal-tech/go-zero/tree/master/tools/goctl/config/readme.md]",
Usage: "the file naming format, see [https://github.com/zeromicro/go-zero/tree/master/tools/goctl/config/readme.md]",
},
cli.StringFlag{
Name: "home",
@@ -259,7 +259,7 @@ var commands = []cli.Command{
},
cli.StringFlag{
Name: "style",
Usage: "the file naming format, see [https://github.com/tal-tech/go-zero/tree/master/tools/goctl/config/readme.md]",
Usage: "the file naming format, see [https://github.com/zeromicro/go-zero/tree/master/tools/goctl/config/readme.md]",
},
},
Action: plugin.PluginCommand,
@@ -405,7 +405,7 @@ var commands = []cli.Command{
Flags: []cli.Flag{
cli.StringFlag{
Name: "style",
Usage: "the file naming format, see [https://github.com/tal-tech/go-zero/tree/master/tools/goctl/config/readme.md]",
Usage: "the file naming format, see [https://github.com/zeromicro/go-zero/tree/master/tools/goctl/config/readme.md]",
},
cli.BoolFlag{
Name: "idea",
@@ -469,7 +469,7 @@ var commands = []cli.Command{
},
cli.StringFlag{
Name: "style",
Usage: "the file naming format, see [https://github.com/tal-tech/go-zero/tree/master/tools/goctl/config/readme.md]",
Usage: "the file naming format, see [https://github.com/zeromicro/go-zero/tree/master/tools/goctl/config/readme.md]",
},
cli.BoolFlag{
Name: "idea",
@@ -513,7 +513,7 @@ var commands = []cli.Command{
},
cli.StringFlag{
Name: "style",
Usage: "the file naming format, see [https://github.com/tal-tech/go-zero/tree/master/tools/goctl/config/readme.md]",
Usage: "the file naming format, see [https://github.com/zeromicro/go-zero/tree/master/tools/goctl/config/readme.md]",
},
cli.BoolFlag{
Name: "cache, c",
@@ -563,7 +563,7 @@ var commands = []cli.Command{
},
cli.StringFlag{
Name: "style",
Usage: "the file naming format, see [https://github.com/tal-tech/go-zero/tree/master/tools/goctl/config/readme.md]",
Usage: "the file naming format, see [https://github.com/zeromicro/go-zero/tree/master/tools/goctl/config/readme.md]",
},
cli.BoolFlag{
Name: "idea",
@@ -615,7 +615,7 @@ var commands = []cli.Command{
},
cli.StringFlag{
Name: "style",
Usage: "the file naming format, see [https://github.com/tal-tech/go-zero/tree/master/tools/goctl/config/readme.md]",
Usage: "the file naming format, see [https://github.com/zeromicro/go-zero/tree/master/tools/goctl/config/readme.md]",
},
cli.BoolFlag{
Name: "idea",
@@ -655,7 +655,7 @@ var commands = []cli.Command{
},
cli.StringFlag{
Name: "style",
Usage: "the file naming format, see [https://github.com/tal-tech/go-zero/tree/master/tools/goctl/config/readme.md]",
Usage: "the file naming format, see [https://github.com/zeromicro/go-zero/tree/master/tools/goctl/config/readme.md]",
},
cli.StringFlag{
Name: "home",

View File

@@ -65,7 +65,7 @@ type User struct {
"context"
"github.com/globalsign/mgo/bson"
cachec "github.com/tal-tech/go-zero/core/stores/cache"
cachec "github.com/zeromicro/go-zero/core/stores/cache"
"github.com/tal-tech/go-zero/core/stores/mongoc"
)

View File

@@ -7,8 +7,8 @@ import (
"context"
"github.com/globalsign/mgo/bson"
{{if .Cache}}cachec "github.com/tal-tech/go-zero/core/stores/cache"
"github.com/tal-tech/go-zero/core/stores/mongoc"{{else}}"github.com/tal-tech/go-zero/core/stores/mongo"{{end}}
{{if .Cache}}cachec "github.com/zeromicro/go-zero/core/stores/cache"
"github.com/zeromicro/go-zero/core/stores/mongoc"{{else}}"github.com/zeromicro/go-zero/core/stores/mongo"{{end}}
)
{{if .Cache}}var prefix{{.Type}}CacheKey = "cache:{{.Type}}:"{{end}}

View File

@@ -4,17 +4,17 @@ import (
"github.com/tal-tech/go-zero/core/stores/builder"
)
// Deprecated: Use github.com/tal-tech/go-zero/core/stores/builder.RawFieldNames instead.
// Deprecated: Use github.com/zeromicro/go-zero/core/stores/builder.RawFieldNames instead.
func FieldNames(in interface{}) []string {
return builder.RawFieldNames(in)
}
// Deprecated: Use github.com/tal-tech/go-zero/core/stores/builder.RawFieldNames instead.
// Deprecated: Use github.com/zeromicro/go-zero/core/stores/builder.RawFieldNames instead.
func RawFieldNames(in interface{}, postgresSql ...bool) []string {
return builder.RawFieldNames(in, postgresSql...)
}
// Deprecated: Use github.com/tal-tech/go-zero/core/stores/builderx.PostgreSqlJoin instead.
// Deprecated: Use github.com/zeromicro/go-zero/core/stores/builderx.PostgreSqlJoin instead.
func PostgreSqlJoin(elems []string) string {
return builder.PostgreSqlJoin(elems)
}

View File

@@ -3,7 +3,7 @@ package template
// Error defines an error template
var Error = `package {{.pkg}}
import "github.com/tal-tech/go-zero/core/stores/sqlx"
import "github.com/zeromicro/go-zero/core/stores/sqlx"
var ErrNotFound = sqlx.ErrNotFound
`

View File

@@ -8,11 +8,11 @@ var (
"strings"
{{if .time}}"time"{{end}}
"github.com/tal-tech/go-zero/core/stores/builder"
"github.com/tal-tech/go-zero/core/stores/cache"
"github.com/tal-tech/go-zero/core/stores/sqlc"
"github.com/tal-tech/go-zero/core/stores/sqlx"
"github.com/tal-tech/go-zero/core/stringx"
"github.com/zeromicro/go-zero/core/stores/builder"
"github.com/zeromicro/go-zero/core/stores/cache"
"github.com/zeromicro/go-zero/core/stores/sqlc"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"github.com/zeromicro/go-zero/core/stringx"
)
`
// ImportsNoCache defines a import template for model in normal case
@@ -22,10 +22,10 @@ var (
"strings"
{{if .time}}"time"{{end}}
"github.com/tal-tech/go-zero/core/stores/builder"
"github.com/tal-tech/go-zero/core/stores/sqlc"
"github.com/tal-tech/go-zero/core/stores/sqlx"
"github.com/tal-tech/go-zero/core/stringx"
"github.com/zeromicro/go-zero/core/stores/builder"
"github.com/zeromicro/go-zero/core/stores/sqlc"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"github.com/zeromicro/go-zero/core/stringx"
)
`
)

View File

@@ -136,7 +136,7 @@ OPTIONS:
--proto_path value, -I value native command of protoc, specify the directory in which to search for imports. [optional]
--go_opt value native command of protoc-gen-go, specify the mapping from proto to go, eg --go_opt=proto_import=go_package_import. [optional]
--dir value, -d value the target path of the code
--style value the file naming format, see [https://github.com/tal-tech/go-zero/tree/master/tools/goctl/config/readme.md]
--style value the file naming format, see [https://github.com/zeromicro/go-zero/tree/master/tools/goctl/config/readme.md]
--idea whether the command execution environment is from idea plugin. [optional]
```

View File

@@ -26,7 +26,7 @@ import (
{{.package}}
"github.com/tal-tech/go-zero/zrpc"
"github.com/zeromicro/go-zero/zrpc"
"google.golang.org/grpc"
)

View File

@@ -13,7 +13,7 @@ import (
const configTemplate = `package config
import "github.com/tal-tech/go-zero/zrpc"
import "github.com/zeromicro/go-zero/zrpc"
type Config struct {
zrpc.RpcServerConf

View File

@@ -22,7 +22,7 @@ import (
{{.imports}}
"github.com/tal-tech/go-zero/core/logx"
"github.com/zeromicro/go-zero/core/logx"
)
type {{.logicName}} struct {

View File

@@ -21,9 +21,9 @@ import (
{{.imports}}
"github.com/tal-tech/go-zero/core/conf"
"github.com/tal-tech/go-zero/core/service"
"github.com/tal-tech/go-zero/zrpc"
"github.com/zeromicro/go-zero/core/conf"
"github.com/zeromicro/go-zero/core/service"
"github.com/zeromicro/go-zero/zrpc"
"google.golang.org/grpc"
"google.golang.org/grpc/reflection"
)

View File

@@ -65,7 +65,7 @@ func TestDefaultProtoParse_Option(t *testing.T) {
p := NewDefaultProtoParser()
data, err := p.Parse("./test_option.proto")
assert.Nil(t, err)
assert.Equal(t, "github.com/tal-tech/go-zero", data.GoPackage)
assert.Equal(t, "github.com/zeromicro/go-zero", data.GoPackage)
assert.Equal(t, "go_zero", data.PbPackage)
}

View File

@@ -2,7 +2,7 @@ syntax = "proto3";
package stream;
option go_package = "github.com/tal-tech/go-zero";
option go_package = "github.com/zeromicro/go-zero";
message placeholder {}

View File

@@ -9,11 +9,11 @@ import (
)
// Upgrade gets the latest goctl by
// go install github.com/tal-tech/go-zero/tools/goctl@latest
// go install github.com/zeromicro/go-zero/tools/goctl@latest
func Upgrade(_ *cli.Context) error {
cmd := `GO111MODULE=on GOPROXY=https://goproxy.cn/,direct go install github.com/tal-tech/go-zero/tools/goctl@latest`
cmd := `GO111MODULE=on GOPROXY=https://goproxy.cn/,direct go install github.com/zeromicro/go-zero/tools/goctl@latest`
if runtime.GOOS == "windows" {
cmd = `set GOPROXY=https://goproxy.cn,direct && go install github.com/tal-tech/go-zero/tools/goctl@latest`
cmd = `set GOPROXY=https://goproxy.cn,direct && go install github.com/zeromicro/go-zero/tools/goctl@latest`
}
info, err := execx.Run(cmd, "")
if err != nil {

View File

@@ -17,7 +17,7 @@ type ProjectContext struct {
// eg: go-zero、greet
Name string
// Path identifies which module a project belongs to, which is module value if it's a go mod project,
// or else it is the root name of the project, eg: github.com/tal-tech/go-zero、greet
// or else it is the root name of the project, eg: github.com/zeromicro/go-zero、greet
Path string
// Dir is the path of the project, eg: /Users/keson/goland/go/go-zero、/Users/keson/go/src/greet
Dir string

View File

@@ -4,7 +4,7 @@ const (
// ProjectName the const value of zero
ProjectName = "zero"
// ProjectOpenSourceURL the github url of go-zero
ProjectOpenSourceURL = "github.com/tal-tech/go-zero"
ProjectOpenSourceURL = "github.com/zeromicro/go-zero"
// OsWindows represents os windows
OsWindows = "windows"
// OsMac represents os mac