From bf9e3b03edfe34bf1679ea53b96f5fe4b849bd05 Mon Sep 17 00:00:00 2001 From: "Scott G. Miller" Date: Tue, 14 Jan 2025 09:17:27 -0600 Subject: [PATCH] Use the new parsepath options --- go.mod | 1 + go.sum | 2 ++ options.go | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index e82ebcb..9f95538 100644 --- a/go.mod +++ b/go.mod @@ -14,6 +14,7 @@ require ( require ( github.com/davecgh/go-spew v1.1.1 // indirect + github.com/hashicorp/go-secure-stdlib v0.1.1-0.20250113211030-e0f8a3489629 // indirect github.com/hashicorp/go-secure-stdlib/strutil v0.1.1 // indirect github.com/hashicorp/go-sockaddr v1.0.2 // indirect github.com/kr/pretty v0.3.0 // indirect diff --git a/go.sum b/go.sum index f426dc6..426e721 100644 --- a/go.sum +++ b/go.sum @@ -8,6 +8,8 @@ github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5Kwzbycv github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-secure-stdlib v0.1.1-0.20250113211030-e0f8a3489629 h1:heq4Ew9a9UIHWwznzI5N4bG5Jb1WhuKaoHhRTOnLwQY= +github.com/hashicorp/go-secure-stdlib v0.1.1-0.20250113211030-e0f8a3489629/go.mod h1:FWbaGK8VHvb9GD7G/FwTwfFoKsLv2cf5wsBmbZUcKUQ= github.com/hashicorp/go-secure-stdlib/parseutil v0.1.7 h1:UpiO20jno/eV1eVZcxqWnUohyKRe1g8FPV/xH1s/2qs= github.com/hashicorp/go-secure-stdlib/parseutil v0.1.7/go.mod h1:QmrqtbKuxxSWTN3ETMPuB+VtEiBJ/A9XhoYGv8E1uD8= github.com/hashicorp/go-secure-stdlib/strutil v0.1.1 h1:nd0HIW15E6FG1MsnArYaHfuw9C2zgzM8LxkG5Ty/788= diff --git a/options.go b/options.go index 1e60be9..bd0c690 100644 --- a/options.go +++ b/options.go @@ -158,7 +158,7 @@ func WithoutHMAC() Option { func ParsePaths(fields ...*string) error { for i := 0; i < len(fields); i++ { - if newVal, err := parseutil.ParsePath(*fields[i]); err != nil { + if newVal, err := parseutil.ParsePath(*fields[i], parseutil.WithNoTrimSpaces(true), parseutil.WithErrorOnMissingEnv(true)); err != nil { return err } else { *fields[i] = newVal