I believe +0 is correct. That is 2 bytes which is what you requested with %+02d and the + takes up the first byte and 0 fits in the second byte.
On Aug 28, 2018, at 10:55 AM, Eric Raymond <e...@thyrsus.com<mailto:e...@thyrsus.com>> wrote: Under Go 1.10.1, feeding an 0 value to a %+02d specifier sometimes yields "+0", not "+00". The attached tiny Go program may reproduce this behavior. I say "may" because I first observed it in a series of unit tests of date format conversions - in different format strings %+02d expanded differently. I haven't found a pattern to this, or I'd report it. On my system this program, at least, has repeatable behavior. If this behavior were consistent, I'm not sure it would be a bug. It's possible that the sign is supposed to be counted as part of the number width; if so, it's an interesting question whether this is the right thing when explicit sign is forced by +. The documentation is unclear. The apparent inconsistency worries me. There may be some state in the form,at-interpretation code that is not always tracked correctly. In accordance with the Contribution Guidelines, I'm tossing the question out here for a sanity check before throwing it on the bugtracker. Have there been any similar reports? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com<mailto:golang-nuts+unsubscr...@googlegroups.com>. For more options, visit https://groups.google.com/d/optout. <gobug1.go> -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.