go mod修改

This commit is contained in:
许 洋 2024-04-30 20:22:44 +08:00
parent 38c0d7db5d
commit 6531106fc3
46 changed files with 99 additions and 100 deletions

View File

@ -2,5 +2,6 @@
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@ -23,14 +23,14 @@ import (
"path/filepath"
"strings"
"github.com/cloudwego/hertz/cmd/hz/config"
"github.com/cloudwego/hertz/cmd/hz/generator"
"github.com/cloudwego/hertz/cmd/hz/meta"
"github.com/cloudwego/hertz/cmd/hz/protobuf"
"github.com/cloudwego/hertz/cmd/hz/thrift"
"github.com/cloudwego/hertz/cmd/hz/util"
"github.com/cloudwego/hertz/cmd/hz/util/logs"
"github.com/urfave/cli/v2"
"gr_hz/config"
"gr_hz/generator"
"gr_hz/meta"
"gr_hz/protobuf"
"gr_hz/thrift"
"gr_hz/util"
"gr_hz/util/logs"
)
// global args. MUST fork it when use

View File

@ -22,10 +22,10 @@ import (
"path/filepath"
"strings"
"github.com/cloudwego/hertz/cmd/hz/meta"
"github.com/cloudwego/hertz/cmd/hz/util"
"github.com/cloudwego/hertz/cmd/hz/util/logs"
"github.com/urfave/cli/v2"
"gr_hz/meta"
"gr_hz/util"
"gr_hz/util/logs"
)
type Argument struct {

View File

@ -24,9 +24,9 @@ import (
"strings"
"syscall"
"github.com/cloudwego/hertz/cmd/hz/meta"
"github.com/cloudwego/hertz/cmd/hz/util"
"github.com/cloudwego/hertz/cmd/hz/util/logs"
"gr_hz/meta"
"gr_hz/util"
"gr_hz/util/logs"
)
func lookupTool(idlType string) (string, error) {

2
doc.go
View File

@ -13,7 +13,7 @@
// limitations under the License.
//
// Package "github.com/cloudwego/hertz/cmd/hz" contains packages for building the hz command line tool.
// Package "gr_hz" contains packages for building the hz command line tool.
// APIs exported by packages under this directory do not promise any backward
// compatibility, so please do not rely on them.

View File

@ -20,8 +20,8 @@ import (
"path/filepath"
"strings"
"github.com/cloudwego/hertz/cmd/hz/generator/model"
"github.com/cloudwego/hertz/cmd/hz/util"
"gr_hz/generator/model"
"gr_hz/util"
)
type ClientMethod struct {

View File

@ -24,8 +24,8 @@ import (
"strings"
"text/template"
"github.com/cloudwego/hertz/cmd/hz/util"
"github.com/cloudwego/hertz/cmd/hz/util/logs"
"gr_hz/util"
"gr_hz/util/logs"
)
type FilePathRenderInfo struct {

View File

@ -22,7 +22,7 @@ import (
"path/filepath"
"strings"
"github.com/cloudwego/hertz/cmd/hz/util"
"gr_hz/util"
)
type File struct {

View File

@ -23,9 +23,9 @@ import (
"path/filepath"
"strings"
"github.com/cloudwego/hertz/cmd/hz/generator/model"
"github.com/cloudwego/hertz/cmd/hz/util"
"github.com/cloudwego/hertz/cmd/hz/util/logs"
"gr_hz/generator/model"
"gr_hz/util"
"gr_hz/util/logs"
)
type HttpMethod struct {

View File

@ -25,9 +25,9 @@ import (
"reflect"
"strings"
"github.com/cloudwego/hertz/cmd/hz/meta"
"github.com/cloudwego/hertz/cmd/hz/util"
"gopkg.in/yaml.v2"
"gr_hz/meta"
"gr_hz/util"
)
// Layout contains the basic information of idl

View File

@ -22,10 +22,10 @@ import (
"strings"
"text/template"
"github.com/cloudwego/hertz/cmd/hz/generator/model"
"github.com/cloudwego/hertz/cmd/hz/generator/model/golang"
"github.com/cloudwego/hertz/cmd/hz/meta"
"github.com/cloudwego/hertz/cmd/hz/util"
"gr_hz/generator/model"
"gr_hz/generator/model/golang"
"gr_hz/meta"
"gr_hz/util"
)
//---------------------------------Backend----------------------------------

View File

@ -20,8 +20,8 @@ import (
"testing"
"text/template"
"github.com/cloudwego/hertz/cmd/hz/generator/model"
"github.com/cloudwego/hertz/cmd/hz/meta"
"gr_hz/generator/model"
"gr_hz/meta"
)
type StringValue struct {

View File

@ -24,10 +24,10 @@ import (
"reflect"
"text/template"
"github.com/cloudwego/hertz/cmd/hz/generator/model"
"github.com/cloudwego/hertz/cmd/hz/meta"
"github.com/cloudwego/hertz/cmd/hz/util"
"gopkg.in/yaml.v2"
"gr_hz/generator/model"
"gr_hz/meta"
"gr_hz/util"
)
type HttpPackage struct {

View File

@ -25,7 +25,7 @@ import (
"sort"
"strings"
"github.com/cloudwego/hertz/cmd/hz/util"
"gr_hz/util"
)
type Router struct {

View File

@ -25,9 +25,9 @@ import (
"strings"
"text/template"
"github.com/cloudwego/hertz/cmd/hz/meta"
"github.com/cloudwego/hertz/cmd/hz/util"
"github.com/cloudwego/hertz/cmd/hz/util/logs"
"gr_hz/meta"
"gr_hz/util"
"gr_hz/util/logs"
)
var DefaultDelimiters = [2]string{"{{", "}}"}

View File

@ -21,7 +21,7 @@ import (
"text/template"
"github.com/Masterminds/sprig/v3"
"github.com/cloudwego/hertz/cmd/hz/util"
"gr_hz/util"
)
var funcMap = func() template.FuncMap {

2
go.mod
View File

@ -1,4 +1,4 @@
module github.com/cloudwego/hertz/cmd/hz
module gr_hz
go 1.16

2
go.sum
View File

@ -95,7 +95,6 @@ golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTk
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.7.0 h1:LapD9S96VoQRhi/GrNTqeBJFrUjs5UHCAtTlgwA5oZA=
golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@ -115,7 +114,6 @@ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=

Binary file not shown.

View File

@ -19,8 +19,8 @@ package main
import (
"os"
"github.com/cloudwego/hertz/cmd/hz/app"
"github.com/cloudwego/hertz/cmd/hz/util/logs"
"gr_hz/app"
"gr_hz/util/logs"
)
func main() {

View File

@ -22,18 +22,18 @@ import (
"sort"
"strings"
"github.com/cloudwego/hertz/cmd/hz/generator"
"github.com/cloudwego/hertz/cmd/hz/generator/model"
"github.com/cloudwego/hertz/cmd/hz/meta"
"github.com/cloudwego/hertz/cmd/hz/protobuf/api"
"github.com/cloudwego/hertz/cmd/hz/util"
"github.com/cloudwego/hertz/cmd/hz/util/logs"
"github.com/jhump/protoreflect/desc"
"google.golang.org/protobuf/compiler/protogen"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/reflect/protoreflect"
"google.golang.org/protobuf/runtime/protoimpl"
"google.golang.org/protobuf/types/descriptorpb"
"gr_hz/generator"
"gr_hz/generator/model"
"gr_hz/meta"
"gr_hz/protobuf/api"
"gr_hz/util"
"gr_hz/util/logs"
)
var BaseProto = descriptorpb.FileDescriptorProto{}

View File

@ -54,18 +54,18 @@ import (
"path/filepath"
"strings"
"github.com/cloudwego/hertz/cmd/hz/config"
"github.com/cloudwego/hertz/cmd/hz/generator"
"github.com/cloudwego/hertz/cmd/hz/generator/model"
"github.com/cloudwego/hertz/cmd/hz/meta"
"github.com/cloudwego/hertz/cmd/hz/util"
"github.com/cloudwego/hertz/cmd/hz/util/logs"
gengo "google.golang.org/protobuf/cmd/protoc-gen-go/internal_gengo"
"google.golang.org/protobuf/compiler/protogen"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/runtime/protoimpl"
"google.golang.org/protobuf/types/descriptorpb"
"google.golang.org/protobuf/types/pluginpb"
"gr_hz/config"
"gr_hz/generator"
"gr_hz/generator/model"
"gr_hz/meta"
"gr_hz/util"
"gr_hz/util/logs"
)
type Plugin struct {

View File

@ -21,9 +21,9 @@ import (
"strings"
"testing"
"github.com/cloudwego/hertz/cmd/hz/meta"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/pluginpb"
"gr_hz/meta"
)
func TestPlugin_Handle(t *testing.T) {

View File

@ -20,10 +20,10 @@ import (
"fmt"
"strings"
"github.com/cloudwego/hertz/cmd/hz/generator/model"
"github.com/cloudwego/hertz/cmd/hz/util"
"github.com/jhump/protoreflect/desc"
"google.golang.org/protobuf/types/descriptorpb"
"gr_hz/generator/model"
"gr_hz/util"
)
type Symbol struct {

View File

@ -22,15 +22,15 @@ import (
"strconv"
"strings"
"github.com/cloudwego/hertz/cmd/hz/config"
"github.com/cloudwego/hertz/cmd/hz/generator"
"github.com/cloudwego/hertz/cmd/hz/generator/model"
"github.com/cloudwego/hertz/cmd/hz/protobuf/api"
"github.com/cloudwego/hertz/cmd/hz/util"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/reflect/protoreflect"
"google.golang.org/protobuf/runtime/protoimpl"
"google.golang.org/protobuf/types/descriptorpb"
"gr_hz/config"
"gr_hz/generator"
"gr_hz/generator/model"
"gr_hz/protobuf/api"
"gr_hz/util"
)
var (

View File

@ -1,7 +1,7 @@
#! /usr/bin/env bash
# const value define
moduleName="github.com/cloudwego/hertz/cmd/hz/test"
moduleName="gr_hz/test"
curDir=`pwd`
thriftIDL=$curDir"/testdata/thrift/psm.thrift"
protobuf2IDL=$curDir"/testdata/protobuf2/psm/psm.proto"

View File

@ -1,7 +1,7 @@
#! /usr/bin/env bash
# const value define
moduleName="github.com/cloudwego/hertz/cmd/hz/test"
moduleName="gr_hz/test"
curDir=`pwd`
thriftIDL=$curDir"/testdata/thrift/psm.thrift"
protobuf2IDL=$curDir"/testdata/protobuf2/psm/psm.proto"

View File

@ -4,7 +4,7 @@ package api;
import "google/protobuf/descriptor.proto";
option go_package = "github.com/cloudwego/hertz/cmd/hz/test/hertz_model/api";
option go_package = "gr_hz/test/hertz_model/api";
extend google.protobuf.FieldOptions {
optional string raw_body = 50101;

View File

@ -4,7 +4,7 @@ package hertz.other;
import "other/other_base.proto";
option go_package = "github.com/cloudwego/hertz/cmd/hz/test/hertz_model/other";
option go_package = "gr_hz/test/hertz_model/other";
message OtherType {
optional string IsBaseString = 1;

View File

@ -2,7 +2,7 @@ syntax = "proto2";
package hertz.other;
option go_package = "github.com/cloudwego/hertz/cmd/hz/test/hertz_model/other";
option go_package = "gr_hz/test/hertz_model/other";
message OtherBaseType {
optional string IsOtherBaseTypeString = 1;

View File

@ -2,7 +2,7 @@ syntax = "proto2";
package base;
option go_package = "github.com/cloudwego/hertz/cmd/hz/test/hertz_model/psm";
option go_package = "gr_hz/test/hertz_model/psm";
message Base {
optional string IsBaseString = 1;

View File

@ -2,7 +2,7 @@ syntax = "proto2";
package psm;
option go_package = "github.com/cloudwego/hertz/cmd/hz/test/hertz_model/psm";
option go_package = "gr_hz/test/hertz_model/psm";
import "api.proto";
import "base.proto";

View File

@ -4,7 +4,7 @@ package api;
import "google/protobuf/descriptor.proto";
option go_package = "github.com/cloudwego/hertz/cmd/hz/test/hertz_model/api";
option go_package = "gr_hz/test/hertz_model/api";
extend google.protobuf.FieldOptions {
optional string raw_body = 50101;

View File

@ -4,7 +4,7 @@ package hertz.other;
import "other/other_base.proto";
option go_package = "github.com/cloudwego/hertz/cmd/hz/test/hertz_model/other";
option go_package = "gr_hz/test/hertz_model/other";
message OtherType {
optional string IsBaseString = 1;

View File

@ -2,7 +2,7 @@ syntax = "proto2";
package hertz.other;
option go_package = "github.com/cloudwego/hertz/cmd/hz/test/hertz_model/other";
option go_package = "gr_hz/test/hertz_model/other";
message OtherBaseType {
optional string IsOtherBaseTypeString = 1;

View File

@ -2,7 +2,7 @@ syntax = "proto2";
package base;
option go_package = "github.com/cloudwego/hertz/cmd/hz/test/hertz_model/psm";
option go_package = "gr_hz/test/hertz_model/psm";
message Base {
optional string IsBaseString = 1;

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package psm;
option go_package = "github.com/cloudwego/hertz/cmd/hz/test/hertz_model/psm";
option go_package = "gr_hz/test/hertz_model/psm";
import "api.proto";
import "base.proto";

View File

@ -21,16 +21,16 @@ import (
"sort"
"strings"
"github.com/cloudwego/hertz/cmd/hz/config"
"github.com/cloudwego/hertz/cmd/hz/generator"
"github.com/cloudwego/hertz/cmd/hz/generator/model"
"github.com/cloudwego/hertz/cmd/hz/meta"
"github.com/cloudwego/hertz/cmd/hz/util"
"github.com/cloudwego/hertz/cmd/hz/util/logs"
"github.com/cloudwego/thriftgo/generator/golang"
"github.com/cloudwego/thriftgo/generator/golang/styles"
"github.com/cloudwego/thriftgo/parser"
"github.com/cloudwego/thriftgo/semantic"
"gr_hz/config"
"gr_hz/generator"
"gr_hz/generator/model"
"gr_hz/meta"
"gr_hz/util"
"gr_hz/util/logs"
)
/*---------------------------Import-----------------------------*/

View File

@ -24,17 +24,17 @@ import (
"path/filepath"
"strings"
"github.com/cloudwego/hertz/cmd/hz/config"
"github.com/cloudwego/hertz/cmd/hz/generator"
"github.com/cloudwego/hertz/cmd/hz/generator/model"
"github.com/cloudwego/hertz/cmd/hz/meta"
"github.com/cloudwego/hertz/cmd/hz/util"
"github.com/cloudwego/hertz/cmd/hz/util/logs"
"github.com/cloudwego/thriftgo/generator/backend"
"github.com/cloudwego/thriftgo/generator/golang"
"github.com/cloudwego/thriftgo/generator/golang/styles"
"github.com/cloudwego/thriftgo/parser"
thriftgo_plugin "github.com/cloudwego/thriftgo/plugin"
"gr_hz/config"
"gr_hz/generator"
"gr_hz/generator/model"
"gr_hz/meta"
"gr_hz/util"
"gr_hz/util/logs"
)
type Plugin struct {

View File

@ -20,9 +20,9 @@ import (
"io/ioutil"
"testing"
"github.com/cloudwego/hertz/cmd/hz/generator"
"github.com/cloudwego/hertz/cmd/hz/meta"
"github.com/cloudwego/thriftgo/plugin"
"gr_hz/generator"
"gr_hz/meta"
)
func TestRun(t *testing.T) {

View File

@ -20,9 +20,9 @@ import (
"fmt"
"strings"
"github.com/cloudwego/hertz/cmd/hz/generator/model"
"github.com/cloudwego/hertz/cmd/hz/util"
"github.com/cloudwego/thriftgo/parser"
"gr_hz/generator/model"
"gr_hz/util"
)
var (

View File

@ -21,8 +21,8 @@ import (
"strings"
"testing"
"github.com/cloudwego/hertz/cmd/hz/config"
"github.com/cloudwego/thriftgo/plugin"
"gr_hz/config"
)
func TestInsertTag(t *testing.T) {

View File

@ -22,11 +22,11 @@ import (
"strconv"
"strings"
"github.com/cloudwego/hertz/cmd/hz/config"
"github.com/cloudwego/hertz/cmd/hz/generator"
"github.com/cloudwego/hertz/cmd/hz/generator/model"
"github.com/cloudwego/hertz/cmd/hz/util"
"github.com/cloudwego/thriftgo/parser"
"gr_hz/config"
"gr_hz/generator"
"gr_hz/generator/model"
"gr_hz/util"
)
const (

View File

@ -26,7 +26,7 @@ import (
"strconv"
"strings"
"github.com/cloudwego/hertz/cmd/hz/util/logs"
"gr_hz/util/logs"
)
func CopyStringSlice(from, to *[]string) {

View File

@ -27,7 +27,7 @@ import (
"regexp"
"strings"
"github.com/cloudwego/hertz/cmd/hz/meta"
"gr_hz/meta"
)
func GetGOPATH() (gopath string, err error) {

View File

@ -24,9 +24,9 @@ import (
"strings"
"time"
"github.com/cloudwego/hertz/cmd/hz/meta"
"github.com/cloudwego/hertz/cmd/hz/util/logs"
gv "github.com/hashicorp/go-version"
"gr_hz/meta"
"gr_hz/util/logs"
)
const ThriftgoMiniVersion = "v0.2.0"