goccy / go-yaml

YAML support for the Go language
MIT License
1.19k stars 134 forks source link

[Question] `<<` within string causes panic #184

Closed gmemstr closed 3 years ago

gmemstr commented 3 years ago

Doing some experimenting, and it appears that << tokens are being parsed even when they're within an unquoted string, resulting in panic: runtime error: invalid memory address or nil pointer dereference.

I can reproduce this with the following YAML file (a minimal CircleCI configuration):

version: 2.1

jobs:
    test:
        docker:
            - image: cimg/go:stable
        steps:
            - run: echo <<parameters>> # If this is enclosed in `""`, panic does not occour

Double quotes aren't totally necessary for these configurations, which means there's a good chance newer configurations leveraging pipeline parameters won't be parseable by this library. My question is - is this behavior intentional?

goccy commented 3 years ago

Thank you for the reporting . This behavior is library's bug, so I fixed this issue with #205