config/default: handle time.Duration

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2023-02-07 06:47:46 +03:00
parent 453d2232bd
commit 98db0dc8bc
2 changed files with 30 additions and 8 deletions

View File

@@ -4,15 +4,19 @@ import (
"context"
"fmt"
"testing"
"time"
"go.unistack.org/micro/v3/config"
mtime "go.unistack.org/micro/v3/util/time"
)
type cfg struct {
StringValue string `default:"string_value"`
IgnoreValue string `json:"-"`
StructValue *cfgStructValue
IntValue int `default:"99"`
StringValue string `default:"string_value"`
IgnoreValue string `json:"-"`
StructValue *cfgStructValue
IntValue int `default:"99"`
DurationValue time.Duration `default:"10s"`
MDurationValue mtime.Duration `default:"10s"`
}
type cfgStructValue struct {