Skip to content

Commit

Permalink
fix(config): Fixing config flag not being parse properly
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Boutour <[email protected]>
  • Loading branch information
ViBiOh committed Aug 28, 2023
1 parent 7216752 commit 433a9d7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.21

require (
github.com/ViBiOh/flags v1.4.1
github.com/ViBiOh/httputils/v4 v4.64.0
github.com/ViBiOh/httputils/v4 v4.64.1
github.com/jackc/pgx/v5 v5.4.3
go.opentelemetry.io/otel/trace v1.16.0
go.uber.org/mock v0.2.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
github.com/ViBiOh/flags v1.4.1 h1:qEAO70rWTYcVlU9BgCuz0SgMjth12oi502cq3SHDudg=
github.com/ViBiOh/flags v1.4.1/go.mod h1:Ocgx/QhY7WYNfGokFT3kw5C05pDooQyLbI/9ZWwylI4=
github.com/ViBiOh/httputils/v4 v4.64.0 h1:prVu49deaZvS24b17rvrkd58K9tYnT+TdDRa/DR0mug=
github.com/ViBiOh/httputils/v4 v4.64.0/go.mod h1:wQcLPM1DA7d8w/ojU1jIZzXwMYBlDJuSw0DrcS33vNc=
github.com/ViBiOh/httputils/v4 v4.64.1 h1:Qc84vfQX9aUedjfjBzrRB+BwABOYZbDvKLQ6pYKKKd4=
github.com/ViBiOh/httputils/v4 v4.64.1/go.mod h1:wQcLPM1DA7d8w/ojU1jIZzXwMYBlDJuSw0DrcS33vNc=
github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
Expand Down
6 changes: 3 additions & 3 deletions pkg/store/memory/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ type Config struct {
Auth string
}

func Flags(fs *flag.FlagSet, prefix string, overrides ...flags.Override) Config {
func Flags(fs *flag.FlagSet, prefix string, overrides ...flags.Override) *Config {
var config Config

flags.New("Users", "Users credentials in the form 'id:login:password,id2:login2:password2'").Prefix(prefix).DocPrefix("memory").StringVar(fs, &config.Ident, "", overrides)
flags.New("Profiles", "Users profiles in the form 'id:profile1|profile2,id2:profile1'").Prefix(prefix).DocPrefix("memory").StringVar(fs, &config.Auth, "", overrides)

return config
return &config
}

func New(config Config) (Service, error) {
func New(config *Config) (Service, error) {
identService, err := loadIdent(config.Ident)
if err != nil {
return Service{}, fmt.Errorf("load ident: %w", err)
Expand Down

0 comments on commit 433a9d7

Please sign in to comment.