This code is not using the API correctly, and the implementation notices this and complains, as it should. Whether it worked in 1.2.1 is unknown to me, but the Split functions are meant to be called only from the Scan method, and are exported for the sole purpose of initializing the Scanner.
Your code is incorrect and the compatibility guarantee does not apply. -rob On Sun, Sep 25, 2016 at 6:47 AM, <bup...@gmail.com> wrote: > (Note: This is complain rather than real bug report. So I wrote here > instead of github issue tracker) > > Related code: https://play.golang.org/p/7l0pUOrX_t > > Background: > > This code is intended to submit to online judge site (i.e. provides > programming questions and judge system to check whether the submitted code > solves given question correctly) > Some modification applied because playground doesn't support os.Stdin. > > > The judge site uses golang 1.2.1, and this code is accepted (= judge > system said this program solves the given problem correctly) > However, on golang 1.7.1, this code panics with message "Split called > after Scan" > > > I think this change is against *Go compatibility guidelines* > <https://golang.org/doc/go1compat.html>, and I couldn't find any reasons > why it should be broken. > > -- > 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. > -- 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.