pelletier / go-toml

Go library for the TOML file format
https://github.com/pelletier/go-toml
Other
1.72k stars 209 forks source link

failed to evaluate const hicb & locb #869

Closed seaChris closed 1 year ago

seaChris commented 1 year ago

Hi,

whenever I try to generate a documentation with swagger I get a failure from two constants out of this project.

This is my error:

2023/05/17 15:06:10 warning: failed to evaluate const locb at /home/vagrant/share/go/pkg/mod/github.com/pelletier/go-toml/v2@v2.0.7/internal/characters/utf8.go:183:2, strconv.ParseUint: parsing "b10000000": invalid syntax 2023/05/17 15:06:10 warning: failed to evaluate const hicb at /home/vagrant/share/go/pkg/mod/github.com/pelletier/go-toml/v2@v2.0.7/internal/characters/utf8.go:184:2, strconv.ParseUint: parsing "b10111111": invalid syntax

I use v2.07 of go-toml

pelletier commented 1 year ago

Hi, this seems like an issue with swagger. This code is internal to go-toml (and a slightly modified version of the standard library). Seems like they don't handle the binary form of constant literals.

jianjianxu commented 1 year ago

I met the same problem, how to fix it?

pelletier commented 1 year ago

If you are using swagger as well I suggest sending them a bug report to handle 0b prefixed constants. If not can you describe how you encountered the issue?

jianjianxu commented 1 year ago

thank u, I did use swagger, I have already sent the report

pelletier commented 1 year ago

Closing since the problem doesn't seem with go-toml.