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

Fix '\t' (byte(9)) in multiline string is invalid #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

electricface
Copy link

@electricface electricface commented Oct 10, 2023

package main

import (
	"fmt"
	"log"

	"github.com/titanous/json5"
)

type Struct struct {
	Str string
}

func main() {
	log.SetFlags(log.Lshortfile)

	var err error
	content := []byte(`{"Str":"hello\
 	abc"}`)
	var st Struct
	err = json5.Unmarshal(content, &st)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(st.Str)
}

// error json5.go:23: invalid character '\t' in string literal

@electricface electricface force-pushed the fix/stateInStringDouble branch from e1b00b3 to f6e5925 Compare October 10, 2023 07:12
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.

1 participant