Skip to content

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