minor changes

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-11-24 00:57:59 +03:00
parent d29363b78d
commit 8a2e84d489
3 changed files with 6 additions and 5 deletions

View File

@ -16,6 +16,7 @@ import (
"go.unistack.org/micro/v3/network/transport"
"go.unistack.org/micro/v3/register"
"go.unistack.org/micro/v3/tracer"
"go.unistack.org/micro/v3/util/id"
)
// Option func
@ -106,7 +107,7 @@ func NewOptions(opts ...Option) Options {
Address: DefaultAddress,
Name: DefaultName,
Version: DefaultVersion,
ID: DefaultID,
ID: id.Must(),
Namespace: DefaultNamespace,
}

View File

@ -8,7 +8,6 @@ import (
"go.unistack.org/micro/v3/codec"
"go.unistack.org/micro/v3/metadata"
"go.unistack.org/micro/v3/register"
"go.unistack.org/micro/v3/util/id"
)
// DefaultServer default server
@ -21,8 +20,6 @@ var (
DefaultName = "server"
// DefaultVersion will be used if no version passed
DefaultVersion = "latest"
// DefaultID will be used if no id passed
DefaultID = id.Must()
// DefaultRegisterCheck holds func that run before register server
DefaultRegisterCheck = func(context.Context) error { return nil }
// DefaultRegisterInterval holds interval for register

View File

@ -91,7 +91,10 @@ func Merge(dst interface{}, mp map[string]interface{}, opts ...Option) error {
val, ok := mp[fname]
if !ok {
continue
val, ok = mp[dfld.Name]
if !ok {
continue
}
}
sval = reflect.ValueOf(val)