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

time: Panic with time.Parse(time.StampNano, [time in time.StampMicro format]) #4502

Closed
gopherbot opened this issue Dec 7, 2012 · 4 comments
Labels
FrozenDueToAge Suggested Issues that may be good for new contributors looking for work to do.
Milestone

Comments

@gopherbot
Copy link

by okeeffeco:

What steps will reproduce the problem?

http://tip.play.golang.org/p/F7jmnR9VD6

What is the expected output?

error, as in the play sample

What do you see instead?

panic: runtime error: slice bounds out of range

goroutine 1 [running]:
time.parseNanoseconds(0x4b2baf, 0x7, 0xa, 0x0, 0x0, ...)
    /home/jake/code/golang/src/pkg/time/format.go:937 +0x14c
time.Parse(0x4b5e19, 0x0, 0x4b2baf, 0x7, 0x46e820, ...)
    /home/jake/code/golang/src/pkg/time/format.go:858 +0x199c
main.main()
    /tmp/t.go:14 +0x51

goroutine 2 [syscall]:
created by runtime.main
    /home/jake/code/golang/src/pkg/runtime/proc.c:225
exit status 2


Which compiler are you using (5g, 6g, 8g, gccgo)?

6g

Which operating system are you using?

Debian Linux
Mac OSX

Which version are you using?

Tested with:

go version devel +a5efcd1675eb Thu Dec 06 09:47:12 2012 -0800
go version devel +88e4ba173900 Wed Nov 28 17:01:59 2012 +1100

Please provide any additional information below.

Realize I'm parsing one format with another, but this is part of an underlying tool
where I don't always know what format is sent in.

Works on release (1.0.3)
@rsc
Copy link
Contributor

rsc commented Dec 10, 2012

Comment 1:

Labels changed: added size-m.

@rsc
Copy link
Contributor

rsc commented Dec 10, 2012

Comment 2:

Labels changed: added suggested.

@davecheney
Copy link
Contributor

Comment 3:

https://golang.org/cl/6949058

Owner changed to @davecheney.

Status changed to Started.

@davecheney
Copy link
Contributor

Comment 4:

This issue was closed by revision 2d3bdab.

Status changed to Fixed.

@gopherbot gopherbot added fixed Suggested Issues that may be good for new contributors looking for work to do. labels Dec 17, 2012
@rsc rsc added this to the Go1.1 milestone Apr 14, 2015
@rsc rsc removed the go1.1 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge Suggested Issues that may be good for new contributors looking for work to do.
Projects
None yet
Development

No branches or pull requests

3 participants