Skip to content

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

Open
electricface wants to merge 1 commit into
titanous:mainfrom
electricface:fix/stateInStringDouble
Open

Fix '\t' (byte(9)) in multiline string is invalid#7
electricface wants to merge 1 commit into
titanous:mainfrom
electricface:fix/stateInStringDouble

Conversation

@electricface

@electricface electricface commented Oct 10, 2023

Copy link
Copy Markdown
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