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

Go 1.15rc1 error format change in ParseDuration #428

Closed
eclipseo opened this issue Jul 30, 2020 · 3 comments · Fixed by #434
Closed

Go 1.15rc1 error format change in ParseDuration #428

eclipseo opened this issue Jul 30, 2020 · 3 comments · Fixed by #434
Assignees
Labels
bug Issues describing a bug in go-toml.

Comments

@eclipseo
Copy link

Describe the bug

Testing    in: /builddir/build/BUILD/go-toml-1.8.0/_build/src
         PATH: /builddir/build/BUILD/go-toml-1.8.0/_build/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin
       GOPATH: /builddir/build/BUILD/go-toml-1.8.0/_build:/usr/share/gocode
  GO111MODULE: off
      command: go test -buildmode pie -compiler gc -ldflags "-X github.com/pelletier/go-toml/version=1.8.0 -extldflags '-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '"
      testing: github.com/pelletier/go-toml
github.com/pelletier/go-toml
{Hello 3.5 {One} [{Two} {Three}]}
--- FAIL: TestUnmarshalBadDuration (0.00s)
    marshal_test.go:2157: unexpected error: (1, 1): Can't convert 1z(string) to time.Duration. time: unknown unit "z" in duration "1z"
FAIL

To Reproduce
Running go test.

Expected behavior
Tests pass.

Versions

  • go-toml: version 1.8.0
  • go: version Go 1.15 rc 1
  • operating system: Fedora Linux Rawhide

Additional context
The error message was modified to add quote around 1z and z, so it is not recognized by

if err.Error() != "(1, 1): Can't convert 1z(string) to time.Duration. time: unknown unit z in duration 1z" {

@moorereason
Copy link
Contributor

Due to golang/go@201cb04.

@pelletier pelletier changed the title Can't convert 1z(string) to time.Duration. time: unknown unit "z" in duration "1z" Go 1.15rc1 error format change in ParseDuration Aug 1, 2020
@pelletier pelletier added the bug Issues describing a bug in go-toml. label Aug 1, 2020
@pelletier
Copy link
Owner

Good catch! Thank you for reporting.

@pelletier pelletier self-assigned this Sep 11, 2020
pelletier added a commit that referenced this issue Sep 11, 2020
pelletier added a commit that referenced this issue Sep 11, 2020
@pelletier
Copy link
Owner

This should be fixed in the latest commit. Feel free to reopen if it doesn't work for you. Sorry it took so long :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues describing a bug in go-toml.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants