Skip to content

Commit ee2cf92

Browse files
authored
Version/v2.6.0 beta (gogf#3183)
1 parent 0b6dd6f commit ee2cf92

File tree

39 files changed

+128
-90
lines changed

39 files changed

+128
-90
lines changed

cmd/gf/go.mod

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ module github.com/gogf/gf/cmd/gf/v2
33
go 1.18
44

55
require (
6-
github.com/gogf/gf/contrib/drivers/clickhouse/v2 v2.5.7
7-
github.com/gogf/gf/contrib/drivers/mssql/v2 v2.5.7
8-
github.com/gogf/gf/contrib/drivers/mysql/v2 v2.5.7
9-
github.com/gogf/gf/contrib/drivers/oracle/v2 v2.5.7
10-
github.com/gogf/gf/contrib/drivers/pgsql/v2 v2.5.7
11-
github.com/gogf/gf/contrib/drivers/sqlite/v2 v2.5.7
12-
github.com/gogf/gf/v2 v2.5.7
6+
github.com/gogf/gf/contrib/drivers/clickhouse/v2 v2.6.0-beta
7+
github.com/gogf/gf/contrib/drivers/mssql/v2 v2.6.0-beta
8+
github.com/gogf/gf/contrib/drivers/mysql/v2 v2.6.0-beta
9+
github.com/gogf/gf/contrib/drivers/oracle/v2 v2.6.0-beta
10+
github.com/gogf/gf/contrib/drivers/pgsql/v2 v2.6.0-beta
11+
github.com/gogf/gf/contrib/drivers/sqlite/v2 v2.6.0-beta
12+
github.com/gogf/gf/v2 v2.6.0-beta
1313
github.com/minio/selfupdate v0.6.0
1414
github.com/olekukonko/tablewriter v0.0.5
1515
golang.org/x/mod v0.9.0

cmd/gf/go.sum

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,6 @@ github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiU
3838
github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
3939
github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI=
4040
github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
41-
github.com/gogf/gf/contrib/drivers/clickhouse/v2 v2.5.6 h1:yziPSf9AycEWphv9WiNjcRAVPOJtUauMMvP6pHQB4jY=
42-
github.com/gogf/gf/contrib/drivers/clickhouse/v2 v2.5.6/go.mod h1:yOlpwhFXgW+P2sf4goA20PUtxdVLliBx4dJRyJeOtto=
43-
github.com/gogf/gf/contrib/drivers/mssql/v2 v2.5.6 h1:LGQIe5IvYVr4hZ/vUAFiqWssxE7QeILyVPJ9swo1Cmk=
44-
github.com/gogf/gf/contrib/drivers/mssql/v2 v2.5.6/go.mod h1:EcF8v8jqCV61/YqN6DXxdo3kh8waGmEj6WpFqbLkkrM=
45-
github.com/gogf/gf/contrib/drivers/mysql/v2 v2.5.6 h1:oR9F4LVoKa/fjf/o6Y/CQRNiYy35Bszo07WwvMWYMxo=
46-
github.com/gogf/gf/contrib/drivers/mysql/v2 v2.5.6/go.mod h1:gvHSRqCpv2c+N0gDHsEldHgU/yM9tcCBdIEKZ32/TaE=
47-
github.com/gogf/gf/contrib/drivers/oracle/v2 v2.5.6 h1:3Y3lEoO9SoG1AmfaKjgTsDt93+T2q/qTMog8wBvIIGM=
48-
github.com/gogf/gf/contrib/drivers/oracle/v2 v2.5.6/go.mod h1:cR3lFoU6ZtSaMQ3DpCJwWnYW6EvHPYGGeqv/kzgH4gw=
49-
github.com/gogf/gf/contrib/drivers/pgsql/v2 v2.5.6 h1:0WHVzqITqIBu/NNPXt3tN2eiWAGiNjs9sg6wh+WbUvY=
50-
github.com/gogf/gf/contrib/drivers/pgsql/v2 v2.5.6/go.mod h1:qZCTNQ0n2gHcuBwM9wUl3pelync3xK0gTnChJZD6f0I=
51-
github.com/gogf/gf/contrib/drivers/sqlite/v2 v2.5.6 h1:6clfLvFoHXHdw+skmXg4yxw+cLwgAG8gRiS/6f9Y9Xc=
52-
github.com/gogf/gf/contrib/drivers/sqlite/v2 v2.5.6/go.mod h1:QV6Rrj+4G4OaJVkP9XXRZ1LWL+ls6qH7ebeMcxsulqA=
53-
github.com/gogf/gf/v2 v2.5.6 h1:a1UK1yUP3s+l+vPxmV91+8gTarAP9b1IEOw0W7LNl6E=
54-
github.com/gogf/gf/v2 v2.5.6/go.mod h1:17K/gBYrp0bHGC3XYC7bSPoywmZ6MrZHrZakTfh4eIQ=
5541
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
5642
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY=
5743
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=

cmd/gf/internal/cmd/cmd_run.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ func init() {
8282
type (
8383
cRunInput struct {
8484
g.Meta `name:"run"`
85-
File string `name:"FILE" arg:"true" brief:"{cRunFileBrief}" v:"required"`
86-
Path string `name:"path" short:"p" brief:"{cRunPathBrief}" d:"./"`
87-
Extra string `name:"extra" short:"e" brief:"{cRunExtraBrief}"`
88-
Args string `name:"args" short:"a" brief:"{cRunArgsBrief}"`
89-
WatchPaths string `name:"watchPaths" short:"w" brief:"{cRunWatchPathsBrief}"`
85+
File string `name:"FILE" arg:"true" brief:"{cRunFileBrief}" v:"required"`
86+
Path string `name:"path" short:"p" brief:"{cRunPathBrief}" d:"./"`
87+
Extra string `name:"extra" short:"e" brief:"{cRunExtraBrief}"`
88+
Args string `name:"args" short:"a" brief:"{cRunArgsBrief}"`
89+
WatchPaths []string `name:"watchPaths" short:"w" brief:"{cRunWatchPathsBrief}"`
9090
}
9191
cRunOutput struct{}
9292
)
@@ -97,12 +97,16 @@ func (c cRun) Index(ctx context.Context, in cRunInput) (out *cRunOutput, err err
9797
mlog.Fatalf(`command "go" not found in your environment, please install golang first to proceed this command`)
9898
}
9999

100+
if len(in.WatchPaths) == 1 {
101+
in.WatchPaths = strings.Split(in.WatchPaths[0], ",")
102+
}
103+
100104
app := &cRunApp{
101105
File: in.File,
102106
Path: in.Path,
103107
Options: in.Extra,
104108
Args: in.Args,
105-
WatchPaths: strings.Split(in.WatchPaths, ","),
109+
WatchPaths: in.WatchPaths,
106110
}
107111
dirty := gtype.NewBool()
108112
_, err = gfsnotify.Add(gfile.RealPath("."), func(event *gfsnotify.Event) {

cmd/gf/internal/cmd/genctrl/genctrl.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ type (
7474
SdkStdVersion bool `short:"v" name:"sdkStdVersion" brief:"{CGenCtrlBriefSdkStdVersion}" orphan:"true"`
7575
SdkNoV1 bool `short:"n" name:"sdkNoV1" brief:"{CGenCtrlBriefSdkNoV1}" orphan:"true"`
7676
Clear bool `short:"c" name:"clear" brief:"{CGenCtrlBriefClear}" orphan:"true"`
77-
Merge bool `short:"m" name:"merge" brief:"{CGenCtrlControllerMerge}" orphan:"true"`
77+
Merge bool `short:"m" name:"merge" brief:"{CGenCtrlControllerMerge}" orphan:"true"`
7878
}
7979
CGenCtrlOutput struct{}
8080
)

contrib/config/apollo/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.18
44

55
require (
66
github.com/apolloconfig/agollo/v4 v4.3.1
7-
github.com/gogf/gf/v2 v2.5.7
7+
github.com/gogf/gf/v2 v2.6.0-beta
88
)
99

1010
require (

contrib/config/consul/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/gogf/gf/contrib/config/consul/v2
33
go 1.19
44

55
require (
6-
github.com/gogf/gf/v2 v2.5.7
6+
github.com/gogf/gf/v2 v2.6.0-beta
77
github.com/hashicorp/consul/api v1.24.0
88
github.com/hashicorp/go-cleanhttp v0.5.2
99
)

contrib/config/kubecm/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/gogf/gf/contrib/config/kubecm/v2
33
go 1.19
44

55
require (
6-
github.com/gogf/gf/v2 v2.5.7
6+
github.com/gogf/gf/v2 v2.6.0-beta
77
k8s.io/api v0.27.4
88
k8s.io/apimachinery v0.27.4
99
k8s.io/client-go v0.27.4

contrib/config/nacos/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/gogf/gf/contrib/config/nacos/v2
33
go 1.18
44

55
require (
6-
github.com/gogf/gf/v2 v2.5.7
6+
github.com/gogf/gf/v2 v2.6.0-beta
77
github.com/nacos-group/nacos-sdk-go v1.1.4
88
)
99

contrib/config/polaris/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/gogf/gf/contrib/config/polaris/v2
33
go 1.18
44

55
require (
6-
github.com/gogf/gf/v2 v2.5.7
6+
github.com/gogf/gf/v2 v2.6.0-beta
77
github.com/polarismesh/polaris-go v1.5.5
88
)
99

contrib/drivers/clickhouse/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.18
44

55
require (
66
github.com/ClickHouse/clickhouse-go/v2 v2.0.15
7-
github.com/gogf/gf/v2 v2.5.7
7+
github.com/gogf/gf/v2 v2.6.0-beta
88
github.com/google/uuid v1.3.0
99
github.com/shopspring/decimal v1.3.1
1010
)

contrib/drivers/dm/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ replace github.com/gogf/gf/v2 => ../../../
66

77
require (
88
gitee.com/chunanyong/dm v1.8.12
9-
github.com/gogf/gf/v2 v2.5.7
9+
github.com/gogf/gf/v2 v2.6.0-beta
1010
)
1111

1212
require (

contrib/drivers/mssql/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.18
44

55
require (
66
github.com/denisenkom/go-mssqldb v0.12.3
7-
github.com/gogf/gf/v2 v2.5.7
7+
github.com/gogf/gf/v2 v2.6.0-beta
88
)
99

1010
require (

contrib/drivers/mysql/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.18
44

55
require (
66
github.com/go-sql-driver/mysql v1.7.1
7-
github.com/gogf/gf/v2 v2.5.7
7+
github.com/gogf/gf/v2 v2.6.0-beta
88
)
99

1010
require (

contrib/drivers/oracle/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/gogf/gf/contrib/drivers/oracle/v2
33
go 1.18
44

55
require (
6-
github.com/gogf/gf/v2 v2.5.7
6+
github.com/gogf/gf/v2 v2.6.0-beta
77
github.com/sijms/go-ora/v2 v2.7.10
88
)
99

contrib/drivers/pgsql/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/gogf/gf/contrib/drivers/pgsql/v2
33
go 1.18
44

55
require (
6-
github.com/gogf/gf/v2 v2.5.7
6+
github.com/gogf/gf/v2 v2.6.0-beta
77
github.com/lib/pq v1.10.9
88
)
99

contrib/drivers/sqlite/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.18
44

55
require (
66
github.com/glebarez/go-sqlite v1.21.2
7-
github.com/gogf/gf/v2 v2.5.7
7+
github.com/gogf/gf/v2 v2.6.0-beta
88
)
99

1010
require (

contrib/drivers/sqlitecgo/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/gogf/gf/contrib/drivers/sqlitecgo/v2
33
go 1.18
44

55
require (
6-
github.com/gogf/gf/v2 v2.5.7
6+
github.com/gogf/gf/v2 v2.6.0-beta
77
github.com/mattn/go-sqlite3 v1.14.17
88
)
99

contrib/nosql/redis/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/gogf/gf/contrib/nosql/redis/v2
33
go 1.18
44

55
require (
6-
github.com/gogf/gf/v2 v2.5.7
6+
github.com/gogf/gf/v2 v2.6.0-beta
77
github.com/redis/go-redis/v9 v9.2.1
88
go.opentelemetry.io/otel v1.14.0
99
go.opentelemetry.io/otel/trace v1.14.0

contrib/registry/etcd/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/gogf/gf/contrib/registry/etcd/v2
33
go 1.18
44

55
require (
6-
github.com/gogf/gf/v2 v2.5.7
6+
github.com/gogf/gf/v2 v2.6.0-beta
77
go.etcd.io/etcd/client/v3 v3.5.7
88
)
99

contrib/registry/file/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module github.com/gogf/gf/contrib/registry/file/v2
22

33
go 1.18
44

5-
require github.com/gogf/gf/v2 v2.5.7
5+
require github.com/gogf/gf/v2 v2.6.0-beta
66

77
require (
88
github.com/BurntSushi/toml v1.2.0 // indirect

contrib/registry/nacos/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/gogf/gf/contrib/registry/nacos/v2
33
go 1.18
44

55
require (
6-
github.com/gogf/gf/v2 v2.5.7
6+
github.com/gogf/gf/v2 v2.6.0-beta
77
github.com/joy999/nacos-sdk-go v0.0.0-20231120071639-10a34b3e7288
88
)
99

contrib/registry/polaris/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/gogf/gf/contrib/registry/polaris/v2
33
go 1.18
44

55
require (
6-
github.com/gogf/gf/v2 v2.5.7
6+
github.com/gogf/gf/v2 v2.6.0-beta
77
github.com/polarismesh/polaris-go v1.5.5
88
)
99

contrib/registry/zookeeper/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.18
44

55
require (
66
github.com/go-zookeeper/zk v1.0.3
7-
github.com/gogf/gf/v2 v2.5.7
7+
github.com/gogf/gf/v2 v2.6.0-beta
88
golang.org/x/sync v0.4.0
99
)
1010

contrib/rpc/grpcx/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ module github.com/gogf/gf/contrib/rpc/grpcx/v2
33
go 1.18
44

55
require (
6-
github.com/gogf/gf/contrib/registry/file/v2 v2.5.7
7-
github.com/gogf/gf/v2 v2.5.7
6+
github.com/gogf/gf/contrib/registry/file/v2 v2.6.0-beta
7+
github.com/gogf/gf/v2 v2.6.0-beta
88
go.opentelemetry.io/otel v1.14.0
99
go.opentelemetry.io/otel/trace v1.14.0
1010
google.golang.org/grpc v1.57.2

contrib/rpc/grpcx/grpcx_grpc_server_config.go

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ package grpcx
88

99
import (
1010
"context"
11-
1211
"google.golang.org/grpc"
1312

1413
"github.com/gogf/gf/v2/frame/g"
@@ -18,18 +17,41 @@ import (
1817

1918
// GrpcServerConfig is the configuration for server.
2019
type GrpcServerConfig struct {
21-
Address string // (optional) Single address for server listening, use `:0` or `ip:0` to serve random port.
22-
Name string // (optional) Name for current service.
23-
Logger *glog.Logger // (optional) Logger for server.
24-
LogPath string // (optional) LogPath specifies the directory for storing logging files.
25-
LogStdout bool // (optional) LogStdout specifies whether printing logging content to stdout.
26-
ErrorStack bool // (optional) ErrorStack specifies whether logging stack information when error.
27-
ErrorLogEnabled bool // (optional) ErrorLogEnabled enables error logging content to files.
28-
ErrorLogPattern string // (optional) ErrorLogPattern specifies the error log file pattern like: error-{Ymd}.log
29-
AccessLogEnabled bool // (optional) AccessLogEnabled enables access logging content to file.
30-
AccessLogPattern string // (optional) AccessLogPattern specifies the error log file pattern like: access-{Ymd}.log
31-
Endpoints []string // (optional) Endpoints are custom endpoints for service register, it uses Address if empty.
32-
Options []grpc.ServerOption // (optional) GRPC Server options.
20+
// (optional) Name for current service.
21+
Name string
22+
23+
// (optional) Single address for server listening, use `:0` or `ip:0` to serve random port.
24+
Address string
25+
26+
// (optional) Logger for server.
27+
Logger *glog.Logger
28+
29+
// (optional) LogPath specifies the directory for storing logging files.
30+
LogPath string
31+
32+
// (optional) LogStdout specifies whether printing logging content to stdout.
33+
LogStdout bool
34+
35+
// (optional) ErrorStack specifies whether logging stack information when error.
36+
ErrorStack bool
37+
38+
// (optional) ErrorLogEnabled enables error logging content to files.
39+
ErrorLogEnabled bool
40+
41+
// (optional) ErrorLogPattern specifies the error log file pattern like: error-{Ymd}.log
42+
ErrorLogPattern string
43+
44+
// (optional) AccessLogEnabled enables access logging content to file.
45+
AccessLogEnabled bool
46+
47+
// (optional) AccessLogPattern specifies the error log file pattern like: access-{Ymd}.log
48+
AccessLogPattern string
49+
50+
// (optional) Endpoints are custom endpoints for service register, it uses Address if empty.
51+
Endpoints []string
52+
53+
// (optional) GRPC Server options.
54+
Options []grpc.ServerOption
3355
}
3456

3557
// NewConfig creates and returns a ServerConfig object with default configurations.
@@ -51,6 +73,7 @@ func (s modServer) NewConfig() *GrpcServerConfig {
5173
)
5274
// Reading configuration file and updating the configured keys.
5375
if g.Cfg().Available(ctx) {
76+
// Server attributes configuration.
5477
if err = g.Cfg().MustGet(ctx, configNodeNameGrpcServer).Struct(&config); err != nil {
5578
g.Log().Error(ctx, err)
5679
}

contrib/sdk/httpclient/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module github.com/gogf/gf/contrib/sdk/httpclient/v2
22

33
go 1.18
44

5-
require github.com/gogf/gf/v2 v2.5.7
5+
require github.com/gogf/gf/v2 v2.6.0-beta
66

77
require (
88
github.com/BurntSushi/toml v1.2.0 // indirect

contrib/trace/jaeger/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/gogf/gf/contrib/trace/jaeger/v2
33
go 1.18
44

55
require (
6-
github.com/gogf/gf/v2 v2.5.7
6+
github.com/gogf/gf/v2 v2.6.0-beta
77
go.opentelemetry.io/otel v1.14.0
88
go.opentelemetry.io/otel/exporters/jaeger v1.14.0
99
go.opentelemetry.io/otel/sdk v1.14.0

contrib/trace/otlpgrpc/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/gogf/gf/contrib/trace/otlpgrpc/v2
33
go 1.20
44

55
require (
6-
github.com/gogf/gf/v2 v2.5.7
6+
github.com/gogf/gf/v2 v2.6.0-beta
77
go.opentelemetry.io/otel v1.19.0
88
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0
99
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0

contrib/trace/otlphttp/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/gogf/gf/contrib/trace/otlphttp/v2
33
go 1.20
44

55
require (
6-
github.com/gogf/gf/v2 v2.5.7
6+
github.com/gogf/gf/v2 v2.6.0-beta
77
go.opentelemetry.io/otel v1.19.0
88
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0
99
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0

errors/gerror/gerror_api_option.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ type Option struct {
1616
Code gcode.Code // Error code if necessary.
1717
}
1818

19-
// NewOption creates and returns a custom error with Option.
19+
// NewWithOption creates and returns a custom error with Option.
2020
// It is the senior usage for creating error, which is often used internally in framework.
21-
func NewOption(option Option) error {
21+
func NewWithOption(option Option) error {
2222
err := &Error{
2323
error: option.Error,
2424
text: option.Text,
@@ -29,3 +29,9 @@ func NewOption(option Option) error {
2929
}
3030
return err
3131
}
32+
33+
// NewOption creates and returns a custom error with Option.
34+
// Deprecated: use NewWithOption instead.
35+
func NewOption(option Option) error {
36+
return NewWithOption(option)
37+
}

0 commit comments

Comments
 (0)