Skip to content

Read field mapping from toml#84

Merged
arl merged 11 commits intomainfrom
read-field-mapping-from-toml
Nov 16, 2020
Merged

Read field mapping from toml#84
arl merged 11 commits intomainfrom
read-field-mapping-from-toml

Conversation

@arl
Copy link
Copy Markdown
Collaborator

@arl arl commented Nov 13, 2020

❓ What

This is another step in the direction of making baker a full-featured binary one can use without touching code.
This gives the possibilty to defined field mapping in TOML. What we call fIeld mapping is a two-way mapping from field indexes and field names.
Before this change, one had to provide 2 function FieldName and FieldByName into baker.Components, even for super basic use of baker. Now you can specify this in TOML, from which 2 closures are generated and assigned into these 2 functions. This is done in NewConfigFromTOML.

🔨 How to test

  1. List all steps necessary;
  2. To test this pull request.

✅ Checklists

This section contains a list of checklists for common uses, please delete the checklists that are useless for your current use case (or add another checklist if your use case isn't covered yet).

  • Is there unit/integration test coverage for all new and/or changed functionality added in this PR?
  • Have the changes in this PR been functionally tested?
  • Has make gofmt-write been run on the code?
  • Has make govet been run on the code? Has the code been fixed accordingly to the output?
  • Have the changes been added to the CHANGELOG.md file?
  • Have the steps in CONTRIBUTING.md been followed to update a Go module?

@arl arl force-pushed the read-field-mapping-from-toml branch 2 times, most recently from 1f4921a to 6aa0a9a Compare November 13, 2020 15:00
Comment thread config.go Outdated
Comment thread examples/basic/main.go Outdated
Copy link
Copy Markdown
Contributor

@tommyblue tommyblue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved the if, lgtm

@tommyblue
Copy link
Copy Markdown
Contributor

perfect

@arl arl merged commit 1ba0e26 into main Nov 16, 2020
@arl arl deleted the read-field-mapping-from-toml branch November 16, 2020 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants