From bb5f5f74144209465bf317a15dbcc5f2dfbed93d Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Tue, 14 Mar 2023 10:59:06 +0300 Subject: [PATCH] merge micro config improvements * update micro to latest release * use Before/After Init funcs Signed-off-by: Vasiliy Tolstov --- env.go | 9 +++++++++ go.mod | 4 ++-- go.sum | 4 ++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/env.go b/env.go index 80b5099..d18ce5f 100644 --- a/env.go +++ b/env.go @@ -27,6 +27,15 @@ func (c *envConfig) Init(opts ...config.Option) error { for _, o := range opts { o(&c.opts) } + + if err := config.DefaultBeforeInit(c.opts.Context, c); err != nil { + return err + } + + if err := config.DefaultAfterInit(c.opts.Context, c); err != nil { + return err + } + return nil } diff --git a/go.mod b/go.mod index fad790e..05315e6 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ module go.unistack.org/micro-config-env/v3 -go 1.16 +go 1.18 require ( github.com/imdario/mergo v0.3.13 - go.unistack.org/micro/v3 v3.10.14 + go.unistack.org/micro/v3 v3.10.15 ) diff --git a/go.sum b/go.sum index 3687050..3c24125 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= github.com/silas/dag v0.0.0-20211117232152-9d50aa809f35/go.mod h1:7RTUFBdIRC9nZ7/3RyRNH1bdqIShrDejd1YbLwgPS+I= -go.unistack.org/micro/v3 v3.10.14 h1:7fgLpwGlCN67twhwtngJDEQvrMkUBDSA5vzZqxIDqNE= -go.unistack.org/micro/v3 v3.10.14/go.mod h1:uMAc0U/x7dmtICCrblGf0ZLgYegu3VwQAquu+OFCw1Q= +go.unistack.org/micro/v3 v3.10.15 h1:vliCUhERMuDB08+XX5V6I+9YZl4jPUaBo3S+Jx1JLSo= +go.unistack.org/micro/v3 v3.10.15/go.mod h1:uMAc0U/x7dmtICCrblGf0ZLgYegu3VwQAquu+OFCw1Q= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -- 2.45.2