Skip to content

json.Parse doesn't treat \r as whitespace #272

Closed
@gopherbot

Description

@gopherbot

by metaphorically:

Before filing a bug, please check whether it has been fixed since
the latest release: run "hg pull -u" and retry what you did to
reproduce the problem.  Thanks.

What steps will reproduce the problem?
1. Call json.Unmarshal with a valid JSON string containing "\r"
2. errtok in return is set to "\r"

What is the expected output? What do you see instead?
Returned error token is set to "\r". No error should occur.

What is your $GOOS?  $GOARCH?
GOOS=linux
GOARCH=amd64

Which revision are you sync'ed to?  (hg log -l 1)
changeset:   4150:cb559bd8a773
tag:         tip
user:        Robert Griesemer <gri@golang.org>
date:        Thu Nov 19 00:04:30 2009 -0800
summary:     bug219: parsing difficulties with 6g


Please provide any additional information below.

The white() function in json/parse.go is missing | c == '\r'. I've made the
change locally and tested it. I can submit my change to the
codereview.appspot.com.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions