Skip to content

Commit

Permalink
Merge pull request #34 from deining/fix-typos
Browse files Browse the repository at this point in the history
Fix typos
  • Loading branch information
ThomasObenaus authored Jan 28, 2025
2 parents 1ec2e56 + efe3c64 commit 2784632
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func main() {
panic(err)
}

// 4. Thats it! Now the config can be used.
// 4. That's it! Now the config can be used.
fmt.Printf("FontConfig: color=%s, name=%s, size=%d\n", cfg.Color, cfg.Name, cfg.Size)
}

Expand Down
4 changes: 2 additions & 2 deletions apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func applyConfig(provider interfaces.Provider, target interface{}, nameOfParentT
logPrefix := fmt.Sprintf("[Apply-(%s)]", fieldName)
provider.Log(interfaces.LogLevelDebug, "%s field-type=%s field-value=%v\n", logPrefix, fieldType, fieldValue)

// handling of non primitives (stucts) that have annotated fields
// handling of non primitives (structs) that have annotated fields
applyConfigOfSubFields := !isPrimitive && !cfgTag.isComplexTypeWithoutAnnotatedFields
if applyConfigOfSubFields {
fieldValueIf := fieldValue.Addr().Interface()
Expand All @@ -77,7 +77,7 @@ func applyConfig(provider interfaces.Provider, target interface{}, nameOfParentT

valueFromViper := provider.Get(cfgTag.Name)

// Handle the case that the values are provied in a []interface{}. This is the case the data comes from yaml.
// Handle the case that the values are provided in a []interface{}. This is the case the data comes from yaml.
// There lists are treated as []interface{} (which then can be []map[string]interface{}, []map[string]string, ...)
valueFromViper, err := handleYamlElementListInput(valueFromViper, fieldType)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cast.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func getConfigTagDefinition(fieldDeclaration reflect.StructField) (string, bool)
}

// createAndFillStruct creates a struct based on the given type and fills its fields based on the given data.
// For being able to fill the struct the given datas keys have to match the config tags that are defined on the target type.
// For being able to fill the struct the given data keys have to match the config tags that are defined on the target type.
//
// e.g. for type
//
Expand Down
2 changes: 1 addition & 1 deletion examples/readme/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ func main() {
panic(err)
}

// 4. Thats it! Now the config can be used.
// 4. That's it! Now the config can be used.
fmt.Printf("FontConfig: color=%s, name=%s, size=%d\n", cfg.Color, cfg.Name, cfg.Size)
}
4 changes: 2 additions & 2 deletions extract_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ func Test_extractConfigTagsOfStruct_Required(t *testing.T) {

// GIVEN
type primitives struct {
SomeFielOptional string `cfg:"{'name':'field-str','desc':'a string field','default':'default value'}"`
SomeFieldOptional string `cfg:"{'name':'field-str','desc':'a string field','default':'default value'}"`
SomeFieldRequired string `cfg:"{'name':'field-str','desc':'a string field'}"`
}
prims := primitives{}
Expand Down Expand Up @@ -270,7 +270,7 @@ func Test_processAllConfigTagsOfStruct(t *testing.T) {
// GIVEN
type primitives struct {
NoConfigTag string
SomeFielOptional string `cfg:"{'name':'field-1','desc':'a string field','default':'default value'}"`
SomeFieldOptional string `cfg:"{'name':'field-1','desc':'a string field','default':'default value'}"`
SomeFieldRequired string `cfg:"{'name':'field-2','desc':'a string field'}"`
}
prims := primitives{}
Expand Down
2 changes: 1 addition & 1 deletion interfaces/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const (
LogLevelDebug LogLevel = "Debug"
// LogLevelInfo info loglevel (contains messages of type info, warn and error)
LogLevelInfo LogLevel = "Info"
// LogLevelWarn waring loglevel (contains messages of type warn and error)
// LogLevelWarn warning loglevel (contains messages of type warn and error)
LogLevelWarn LogLevel = "Warn"
// LogLevelError error loglevel (contains messages of type error)
LogLevelError LogLevel = "Error"
Expand Down

0 comments on commit 2784632

Please sign in to comment.