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

Add Marshal Function #405

Merged
merged 2 commits into from
May 2, 2024
Merged

Add Marshal Function #405

merged 2 commits into from
May 2, 2024

Conversation

samawise
Copy link
Contributor

@samawise samawise commented May 2, 2024

Added the Marshal function which returns the TOML representation of the Go value as bytes along with any error that may occur while marshaling. This adds parity with the existing Unmarshal function and conforms to the standard libraries JSON package, which also has both Unmarshal and Marshal.

Added the Marshal function which returns the TOML representation of the Go value as bytes along with any error that may occur while marshaling.
@arp242
Copy link
Collaborator

arp242 commented May 2, 2024

Seems okay to add; can you add a basic test? Or maybe just modify one of the calls in TestEncodeRoundTrip(). Just to ensure the function is called and works – doesn't need to be comprehensive or anything.

Added a test for the Marshal function within TestEncodeRoundTrip.
@samawise
Copy link
Contributor Author

samawise commented May 2, 2024

Wrote a test for it under TestEncodeRoundTrip().

@arp242
Copy link
Collaborator

arp242 commented May 2, 2024

Cheers, thanks

@arp242 arp242 merged commit 77ce858 into BurntSushi:master May 2, 2024
6 checks passed
nrdufour pushed a commit to nrdufour/marmitton that referenced this pull request May 24, 2024
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/BurntSushi/toml](https://github.com/BurntSushi/toml) | require | minor | `v1.3.2` -> `v1.4.0` |

---

### Release Notes

<details>
<summary>BurntSushi/toml (github.com/BurntSushi/toml)</summary>

### [`v1.4.0`](https://github.com/BurntSushi/toml/releases/tag/v1.4.0)

[Compare Source](BurntSushi/toml@v1.3.2...v1.4.0)

This version requires Go 1.18

-   Add toml.Marshal() ([#&#8203;405](BurntSushi/toml#405))

-   Require 2-digit hour ([#&#8203;320](BurntSushi/toml#320))

-   Wrap UnmarshalTOML() and UnmarshalText() return values in ParseError for position information ([#&#8203;398](BurntSushi/toml#398))

-   Fix inline tables with dotted keys inside inline arrays (e.g. `k=[{a.b=1}]`) ([#&#8203;400](BurntSushi/toml#400))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNzQuMyIsInVwZGF0ZWRJblZlciI6IjM3LjM3NC4zIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Reviewed-on: https://git.internal/nrdufour/marmitton/pulls/31
Co-authored-by: Renovate <renovate@ptinem.casa>
Co-committed-by: Renovate <renovate@ptinem.casa>
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