From 1b617284a18d40840ab1e0e6e0ed0b73f9b33f1c Mon Sep 17 00:00:00 2001 From: xgfone Date: Sun, 29 Aug 2021 18:01:51 +0800 Subject: [PATCH] fix: add the prefix for the aliases when registering the options --- opt_group.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/opt_group.go b/opt_group.go index f1f3f5e..606749c 100644 --- a/opt_group.go +++ b/opt_group.go @@ -77,6 +77,9 @@ func (g *OptGroup) RegisterOpts(opts ...Opt) { _opts := make([]Opt, len(opts)) for i, opt := range opts { opt.Name = g.prefix + opt.Name + for i, alias := range opt.Aliases { + opt.Aliases[i] = g.prefix + alias + } _opts[i] = opt } g.config.RegisterOpts(_opts...)