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

Unmarshal drops lines and does not return error #459

Open
jdistler opened this issue Jul 1, 2024 · 0 comments
Open

Unmarshal drops lines and does not return error #459

jdistler opened this issue Jul 1, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jdistler
Copy link

jdistler commented Jul 1, 2024

Describe the bug
When unmarshalling yaml files with certain kinds of whitespace errors, an error is not returned and all content after the whitespace error is truncated.

To Reproduce

https://go.dev/play/p/WgvHk09B-Px

Expected behavior

The expected behavior is that at err := yaml.Unmarshal(originalData, &content);, we return a non-nil error since we could not parse the entire file.

Screenshots

Let's say we have a yaml file with these contents:

formatVersion: 1
name: some name
description: |
  some description
continuing the description without proper whitespace
system: some system
source: snowflake

This is most definitely invalid yaml -

Screenshot 2024-07-01 at 1 53 43 PM

Screenshot 2024-07-01 at 1 53 54 PM

Version Variables

  • Go version: v1.22.3
  • go-yaml's Version: v1.11.2
@jdistler jdistler added the bug Something isn't working label Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant