Commit graph

646 commits

Author SHA1 Message Date
Travis Newhouse
21336ce35f Add CaseSensitiveKeys option
When reading configuration from sources with case-sensitive keys,
such as YAML, TOML, and JSON, a user may wish to preserve the case
of keys that appear in maps.  For example, consider when the value
of a setting is a map with string keys that are case-sensitive.
Ideally, if the value is not going to be indexed by a Viper lookup
key, then the map value should be treated as an opaque value by
Viper, and its keys should not be modified.  See #1014

Viper's default behaviour is that keys are case-sensitive, and this
behavior is implemented by converting all keys to lower-case.  For
users that wish to preserve the case of keys, this commit introduces
an Option `CaseSensitiveKeys()` that can be used to configure Viper
to use case-sensitive keys.  When CaseSensitiveKeys is enabled, all
keys retain the original case, and lookups become case-sensitive
(except for lookups of values bound to environment variables).

The behavior of Viper could become hard to understand if a user
could change the CaseSensitiveKeys setting after values have been
stored.  For this reason, the setting may only be set when creating
a Viper instance, and it cannot be set on the "global" Viper.
2023-10-20 15:09:25 -07:00
Oleksandr Redko
b5daec6e7b test: Replace ifs with asserts to simplify tests 2023-10-14 02:12:35 +02:00
dependabot[bot]
b6610e7702 build(deps): bump golang.org/x/net from 0.15.0 to 0.17.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.15.0 to 0.17.0.
- [Commits](https://github.com/golang/net/compare/v0.15.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-14 02:11:19 +02:00
dependabot[bot]
4b59dd6386 build(deps): bump github/codeql-action from 2.21.9 to 2.22.3
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.21.9 to 2.22.3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](ddccb87388...0116bc2df5)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-14 02:10:56 +02:00
Oleksandr Redko
dd9a341aec Rename 2023-10-06 15:06:37 +02:00
Oleksandr Redko
1d75c512ef chore: rename files according enabled build tags 2023-10-06 15:06:37 +02:00
Ville Skyttä
f62f86a84b refactor: make use of strings.Cut 2023-10-06 14:22:22 +02:00
Étienne BERSAC
94632fa21e chore: Use pip3 explicitly to install yamllint
Distribution stends to skip unversionned pip for compatibility issues.
Also, yamllint requires Python 3.8+.

Signed-off-by: Étienne BERSAC <etienne.bersac@dalibo.com>
2023-10-06 14:12:00 +02:00
Étienne BERSAC
3f6cadcbeb chore: Fix copy-paste error for yamllint target
Signed-off-by: Étienne BERSAC <etienne.bersac@dalibo.com>
2023-10-06 14:12:00 +02:00
yhliyr
287507c0b5 docs: add set subset KV example 2023-10-06 14:09:32 +02:00
Mark Sagi-Kazar
f1cb2262bb chore(deps): update crypt
Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
2023-10-05 22:52:58 +02:00
Oleksandr Redko
c292b55050 test: refactor asserts 2023-10-05 00:58:18 +02:00
Oleksandr Redko
3d006fe361 refactor: replace interface{} with any 2023-10-01 17:04:26 +02:00
dependabot[bot]
8a6dc5d43c build(deps): bump github/codeql-action from 2.21.8 to 2.21.9
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.21.8 to 2.21.9.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](6a28655e3d...ddccb87388)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-01 15:39:02 +02:00
Oleksandr Redko
96c5c0083f chore: remove deprecated build tags 2023-09-25 13:19:04 +02:00
dependabot[bot]
44911d2cac build(deps): bump github/codeql-action from 2.21.7 to 2.21.8
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.21.7 to 2.21.8.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](04daf014b5...6a28655e3d)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-25 12:34:26 +02:00
dependabot[bot]
a6f8e227bb build(deps): bump github.com/spf13/afero from 1.9.5 to 1.10.0
Bumps [github.com/spf13/afero](https://github.com/spf13/afero) from 1.9.5 to 1.10.0.
- [Release notes](https://github.com/spf13/afero/releases)
- [Commits](https://github.com/spf13/afero/compare/v1.9.5...v1.10.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/afero
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-25 12:34:09 +02:00
dependabot[bot]
a9437f2500 build(deps): bump actions/checkout from 4.0.0 to 4.1.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.0.0 to 4.1.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](3df4ab11eb...8ade135a41)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-25 12:33:39 +02:00
Mark Sagi-Kazar
cae55fefc9 fix: result order by upgrading locafero
Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
2023-09-16 14:01:33 +02:00
Mark Sagi-Kazar
f2e0e48e6b fix: compile error
Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
2023-09-16 14:01:33 +02:00
Mark Sagi-Kazar
db5aafac4d feat: enable finder tag builds
Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
2023-09-16 14:01:33 +02:00
Mark Sagi-Kazar
abbfd91119 feat: replace io fs finder with afero finder
Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
2023-09-16 14:01:33 +02:00
Mark Sagi-Kazar
cfa8fd9b4f feat: use new finder library
Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
2023-09-16 14:01:33 +02:00
Oleksandr Redko
6fdfebc843 Fix tests on Windows 2023-09-16 13:48:38 +02:00
Oleksandr Redko
4aeec5882c Remove usages of deprecated io/ioutil; simplify tests 2023-09-16 13:48:38 +02:00
dependabot[bot]
f683416bfb build(deps): bump github/codeql-action from 2.21.6 to 2.21.7
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.21.6 to 2.21.7.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](701f152f28...04daf014b5)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-16 13:47:30 +02:00
dependabot[bot]
336e9f0a93 build(deps): bump github/codeql-action from 2.21.5 to 2.21.6
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.21.5 to 2.21.6.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](00e563ead9...701f152f28)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-13 23:05:26 +02:00
Mark Sagi-Kazar
58b177a8c0 fix: lint violations
Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
2023-09-13 16:24:59 +02:00
Mark Sagi-Kazar
2672f3e4d3 refactor: drop unused jww code
Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
2023-09-13 16:24:59 +02:00
Mark Sagi-Kazar
0c5594ae7a feat: deprecate logger interface
Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
2023-09-13 16:24:59 +02:00
Mark Sagi-Kazar
d16deb4b93 feat: add slog support
Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
2023-09-13 16:24:59 +02:00
Mark Sagi-Kazar
d4c2f2ef40 feat!: bump minimum Go version to 1.19
Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
2023-09-12 00:17:53 +02:00
dependabot[bot]
c78218cb99 build(deps): bump actions/dependency-review-action from 3.0.8 to 3.1.0
Bumps [actions/dependency-review-action](https://github.com/actions/dependency-review-action) from 3.0.8 to 3.1.0.
- [Release notes](https://github.com/actions/dependency-review-action/releases)
- [Commits](f6fff72a32...6c5ccdad46)

---
updated-dependencies:
- dependency-name: actions/dependency-review-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-09 07:55:48 +02:00
John Hooks
1e811d1f02 Add NATS support 2023-09-08 15:32:50 +02:00
Mark Sagi-Kazar
d5c5c83bfc ci: add Go 1.21 to the test matrix
Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
2023-09-08 15:30:13 +02:00
Mark Sagi-Kazar
b425370376 chore(deps): update crypt
Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
2023-09-08 15:29:58 +02:00
dependabot[bot]
27914f862f build(deps): bump cachix/install-nix-action from 22 to 23
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 22 to 23.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](6ed004b9cc...6a9a9e84a1)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-08 14:23:57 +02:00
dependabot[bot]
3718c2ec5a build(deps): bump github.com/subosito/gotenv from 1.4.2 to 1.6.0
Bumps [github.com/subosito/gotenv](https://github.com/subosito/gotenv) from 1.4.2 to 1.6.0.
- [Changelog](https://github.com/subosito/gotenv/blob/master/CHANGELOG.md)
- [Commits](https://github.com/subosito/gotenv/compare/v1.4.2...v1.6.0)

---
updated-dependencies:
- dependency-name: github.com/subosito/gotenv
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-08 14:23:33 +02:00
Oleksandr Redko
13dbfcafff test: remove testutil.Setenv as not needed from Go 1.17 2023-09-07 13:33:21 +02:00
Oleksandr Redko
a0696bbc97 docs: fix typos in comments 2023-09-07 13:32:51 +02:00
dependabot[bot]
c63105849f build(deps): bump actions/setup-go from 4.0.1 to 4.1.0
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4.0.1 to 4.1.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](fac708d667...93397bea11)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-07 12:53:14 +02:00
dependabot[bot]
2bd8c8e48d build(deps): bump golangci/golangci-lint-action from 3.6.0 to 3.7.0
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 3.6.0 to 3.7.0.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](639cd343e1...3a91952989)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-07 12:27:58 +02:00
dependabot[bot]
0195f11e50 build(deps): bump actions/dependency-review-action from 3.0.6 to 3.0.8
Bumps [actions/dependency-review-action](https://github.com/actions/dependency-review-action) from 3.0.6 to 3.0.8.
- [Release notes](https://github.com/actions/dependency-review-action/releases)
- [Commits](1360a344cc...f6fff72a32)

---
updated-dependencies:
- dependency-name: actions/dependency-review-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-07 12:27:42 +02:00
dependabot[bot]
64661d4342 build(deps): bump github.com/pelletier/go-toml/v2 from 2.0.9 to 2.1.0
Bumps [github.com/pelletier/go-toml/v2](https://github.com/pelletier/go-toml) from 2.0.9 to 2.1.0.
- [Release notes](https://github.com/pelletier/go-toml/releases)
- [Changelog](https://github.com/pelletier/go-toml/blob/v2/.goreleaser.yaml)
- [Commits](https://github.com/pelletier/go-toml/compare/v2.0.9...v2.1.0)

---
updated-dependencies:
- dependency-name: github.com/pelletier/go-toml/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-07 12:27:28 +02:00
dependabot[bot]
59cd02f67b build(deps): bump github/codeql-action from 2.21.2 to 2.21.5
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.21.2 to 2.21.5.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](0ba4244466...00e563ead9)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-07 12:27:14 +02:00
dependabot[bot]
7b2db61200 build(deps): bump actions/checkout from 3.5.3 to 4.0.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.3 to 4.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](c85c95e3d7...3df4ab11eb)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-07 12:27:00 +02:00
Andres Taylor
24cfadcf0f Add Vitess to list of projects using Viper
Signed-off-by: Andres Taylor <andres@planetscale.com>
2023-09-07 12:26:29 +02:00
StepSecurity Bot
b77f4c1928 [StepSecurity] ci: Harden GitHub Actions
Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>
2023-08-04 11:38:34 +02:00
guangwu
cb9b2bffc2
fix: code optimization (#1557)
* fix: code optimization

* fix: golangci-lint
2023-07-27 20:56:32 +02:00
Mark Sagi-Kazar
c5102bdba0 chore: upgrade crypt
Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
2023-07-21 16:13:01 +02:00