Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

**Issues:** https://github.com/pelletier/go-toml/issues/238 #241

Merged
merged 2 commits into from
Sep 21, 2018

Conversation

asenyshyn
Copy link
Contributor

Allow to change default tags for Decoder and Encoder

Decoder: allow to customize default field name tag "toml" on decoding.
Example:

type doc struct {
    title `file:"header"`
}

Encoder: allow to customize tags for encoding struct to toml.

type doc struct {
    title `file:"header" description:"document title"`
}

Issue: add link to pelletier/go-toml issue here

Explanation of what this pull request does.

More detailed description of the decisions being made and the reasons why (if the patch is non-trivial).

Allow to change default tags for Decoder and Encoder

Decoder: allow to customize default field name tag "toml" on decoding.
Example:
```
type doc struct {
    title `file:"header"`
}
```

Encoder: allow to customize tags for encoding struct to toml.
```
type doc struct {
    title `file:"header" description:"document title"`
}
```
@codecov
Copy link

codecov bot commented Sep 21, 2018

Codecov Report

Merging #241 into master will increase coverage by 0.48%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #241      +/-   ##
==========================================
+ Coverage   88.47%   88.96%   +0.48%     
==========================================
  Files           9        9              
  Lines        1649     1667      +18     
==========================================
+ Hits         1459     1483      +24     
+ Misses        135      132       -3     
+ Partials       55       52       -3
Impacted Files Coverage Δ
marshal.go 88.95% <100%> (+2.45%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e33f654...63ec95a. Read the comment docs.

@pelletier pelletier merged commit 90d6f96 into pelletier:master Sep 21, 2018
@pelletier
Copy link
Owner

Merged. Fantastic PR! Thank you very much!

@asenyshyn asenyshyn deleted the customize-struct-tag branch September 21, 2018 16:44
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.

3 participants