From a0696bbc971ee8752463ba36fe19d3bb096a44ca Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Fri, 18 Aug 2023 16:29:46 +0300 Subject: [PATCH] docs: fix typos in comments --- README.md | 2 +- flags.go | 2 +- internal/encoding/dotenv/map_utils.go | 2 +- internal/encoding/ini/map_utils.go | 2 +- internal/encoding/javaproperties/map_utils.go | 2 +- logger.go | 2 +- viper_test.go | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index fff4987..b8c217c 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,7 @@ if err := viper.ReadInConfig(); err != nil { // Config file found and successfully parsed ``` -*NOTE [since 1.6]:* You can also have a file without an extension and specify the format programmaticaly. For those configuration files that lie in the home of the user without any extension like `.bashrc` +*NOTE [since 1.6]:* You can also have a file without an extension and specify the format programmatically. For those configuration files that lie in the home of the user without any extension like `.bashrc` ### Writing Config Files diff --git a/flags.go b/flags.go index b5ddbf5..ddb4da6 100644 --- a/flags.go +++ b/flags.go @@ -30,7 +30,7 @@ func (p pflagValueSet) VisitAll(fn func(flag FlagValue)) { }) } -// pflagValue is a wrapper aroung *pflag.flag +// pflagValue is a wrapper around *pflag.flag // that implements FlagValue type pflagValue struct { flag *pflag.Flag diff --git a/internal/encoding/dotenv/map_utils.go b/internal/encoding/dotenv/map_utils.go index e880c95..aeb6b87 100644 --- a/internal/encoding/dotenv/map_utils.go +++ b/internal/encoding/dotenv/map_utils.go @@ -7,7 +7,7 @@ import ( ) // flattenAndMergeMap recursively flattens the given map into a new map -// Code is based on the function with the same name in tha main package. +// Code is based on the function with the same name in the main package. // TODO: move it to a common place func flattenAndMergeMap(shadow map[string]interface{}, m map[string]interface{}, prefix string, delimiter string) map[string]interface{} { if shadow != nil && prefix != "" && shadow[prefix] != nil { diff --git a/internal/encoding/ini/map_utils.go b/internal/encoding/ini/map_utils.go index f39e95d..4fb9eb1 100644 --- a/internal/encoding/ini/map_utils.go +++ b/internal/encoding/ini/map_utils.go @@ -40,7 +40,7 @@ func deepSearch(m map[string]interface{}, path []string) map[string]interface{} } // flattenAndMergeMap recursively flattens the given map into a new map -// Code is based on the function with the same name in tha main package. +// Code is based on the function with the same name in the main package. // TODO: move it to a common place func flattenAndMergeMap(shadow map[string]interface{}, m map[string]interface{}, prefix string, delimiter string) map[string]interface{} { if shadow != nil && prefix != "" && shadow[prefix] != nil { diff --git a/internal/encoding/javaproperties/map_utils.go b/internal/encoding/javaproperties/map_utils.go index 673bb70..eb53790 100644 --- a/internal/encoding/javaproperties/map_utils.go +++ b/internal/encoding/javaproperties/map_utils.go @@ -40,7 +40,7 @@ func deepSearch(m map[string]interface{}, path []string) map[string]interface{} } // flattenAndMergeMap recursively flattens the given map into a new map -// Code is based on the function with the same name in tha main package. +// Code is based on the function with the same name in the main package. // TODO: move it to a common place func flattenAndMergeMap(shadow map[string]interface{}, m map[string]interface{}, prefix string, delimiter string) map[string]interface{} { if shadow != nil && prefix != "" && shadow[prefix] != nil { diff --git a/logger.go b/logger.go index a64e144..3f69e98 100644 --- a/logger.go +++ b/logger.go @@ -36,7 +36,7 @@ type Logger interface { // // Critical events that require immediate attention. // Loggers commonly provide Fatal and Panic levels above Error level, - // but exiting and panicing is out of scope for a logging library. + // but exiting and panicking is out of scope for a logging library. Error(msg string, keyvals ...interface{}) } diff --git a/viper_test.go b/viper_test.go index e0bfc57..1947d8d 100644 --- a/viper_test.go +++ b/viper_test.go @@ -2283,7 +2283,7 @@ clothing: func TestDotParameter(t *testing.T) { initJSON() - // shoud take precedence over batters defined in jsonExample + // should take precedence over batters defined in jsonExample r := bytes.NewReader([]byte(`{ "batters.batter": [ { "type": "Small" } ] }`)) unmarshalReader(r, v.config)