So, as per the link that I sent, a json file is not a text file, right? is just a file, I want to have this clear
thanks On Tue, Jan 30, 2024 at 3:50 PM 'Brian Candler' via golang-nuts < golang-nuts@googlegroups.com> wrote: > The JSON spec does not require any whitespace after the object, newline or > otherwise. And POSIX does not require that files end with a newline. > > Maybe you are thinking of another spec, like https://jsonlines.org/ - but > that's not part of JSON. > > On Tuesday 30 January 2024 at 14:16:35 UTC Xabi Martí wrote: > >> I'm writing a program that uses enconding/json and when writing the files >> I see that it doesn't add a newline character at the end of the file, >> according to >> https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206 >> it is supposed that a line is: >> >> 3.206 Line >> A sequence of zero or more non- <newline> characters plus a terminating >> <newline> character. >> >> so, I've to add it manually? why is not POSIX compatible? >> >> example: >> >> cat -e file.json | tail -n 2 >> }$ >> }% >> >> any help? thanks! >> > -- > You received this message because you are subscribed to a topic in the > Google Groups "golang-nuts" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/golang-nuts/qjxJ3Zunzfc/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > golang-nuts+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/golang-nuts/692bd65e-74f4-448a-b399-de8c38785aefn%40googlegroups.com > <https://groups.google.com/d/msgid/golang-nuts/692bd65e-74f4-448a-b399-de8c38785aefn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CADGekL9DmFLahU8WnJRPrMyAreRi4LC3y_fFhrTtqXZ0oKh1jQ%40mail.gmail.com.