Re: [go-nuts] Strip HTML comments before processing template

2024-12-30 Thread Jon Perryman
Sorry, I was thinking you were talking about the html template tags. HTML comments are processed like any other html tag. Does one of the following produce the results you are looking for: {{ `` }} {{ /* `` */ }} On Mon, Dec 30, 2024 at 10:34 PM Emrah ATILKAN wrote: > I don’t think it is J

Re: [go-nuts] Strip HTML comments before processing template

2024-12-30 Thread Kurtis Rader
You should always include the full error message (and backtrace if available) as well as telling us the relevant version of Go you used to compile your program and the particular package you believe is the source of the problem. A minimal reproducible example is also a good idea if feasible. In th

Re: [go-nuts] Strip HTML comments before processing template

2024-12-30 Thread Emrah ATILKAN
I don’t think it is JS error. This is a Go runtime error. Not from browser console, from terminal. On Tue, Dec 31, 2024 at 02:33 Jon Perryman wrote: > *"can't evaluate field nonExistingData"* looks like a javascript error > message because it says evaluated. HTML would not evaluate stuff. The o

Re: [go-nuts] Is it necessary to change the behavior of maps.Keys and maps.Values?

2024-12-30 Thread Xu Liu
On Tue, Dec 31, 2024 at 1:40 PM Axel Wagner wrote: > > Please note that "maps.Collect" is slow. > https://github.com/golang/go/issues/68261 > > Please note that I did address that in my message. > CollectN matters most for non-trivial iterators, e.g. where you first > transform an iterator using

Re: [go-nuts] Is it necessary to change the behavior of maps.Keys and maps.Values?

2024-12-30 Thread 'Axel Wagner' via golang-nuts
> Please note that "maps.Collect" is slow. https://github.com/golang/go/issues/68261 Please note that I did address that in my message. CollectN matters most for non-trivial iterators, e.g. where you first transform an iterator using `xiter.Map` or the like. Something like slices.Collect(maps.Keys

Re: [go-nuts] Is it necessary to change the behavior of maps.Keys and maps.Values?

2024-12-30 Thread fliter
Thank you all for the discussion, it was very helpful! 在2024年12月31日星期二 UTC+8 10:10:12 写道: > On Tuesday, December 31, 2024 at 9:42:50 AM UTC+8 tapi...@gmail.com wrote: > > On Monday, December 30, 2024 at 6:12:10 AM UTC+8 Axel Wagner wrote: > > Why don't I use the sequence versions more frequently?

Re: [go-nuts] Is it necessary to change the behavior of maps.Keys and maps.Values?

2024-12-30 Thread tapi...@gmail.com
On Tuesday, December 31, 2024 at 9:42:50 AM UTC+8 tapi...@gmail.com wrote: On Monday, December 30, 2024 at 6:12:10 AM UTC+8 Axel Wagner wrote: Why don't I use the sequence versions more frequently? Because I try not to create huge in-memory maps and instead prefer to move logic that manipulat

Re: [go-nuts] Unexpected behavior where panic raised in-between two phases of an assignment statement

2024-12-30 Thread tapi...@gmail.com
There is not a phase between in-between, Any evaluation must happen in either of the two phases. On Sunday, December 29, 2024 at 3:13:38 PM UTC+8 Kaiming Yang wrote: > An update from the bug: Seems the behavior is WAI because the execution > order of dereference and function calls are not defi

Re: [go-nuts] Is it necessary to change the behavior of maps.Keys and maps.Values?

2024-12-30 Thread tapi...@gmail.com
On Monday, December 30, 2024 at 6:12:10 AM UTC+8 Axel Wagner wrote: Why don't I use the sequence versions more frequently? Because I try not to create huge in-memory maps and instead prefer to move logic that manipulates large amounts of data into a proper database. Iterators are more effi

Re: [go-nuts] Is it necessary to change the behavior of maps.Keys and maps.Values?

2024-12-30 Thread tapi...@gmail.com
Please note that "maps.Collect" is slow. https://github.com/golang/go/issues/68261 It is best to write your own custom Collect function. On Monday, December 30, 2024 at 5:50:47 AM UTC+8 Mike Schinkel wrote: > > On Dec 29, 2024, at 1:28 AM, Axel Wagner > wrote: > > > > At the end of the day,

Re: [go-nuts] Strip HTML comments before processing template

2024-12-30 Thread Jon Perryman
*"can't evaluate field nonExistingData"* looks like a javascript error message because it says evaluated. HTML would not evaluate stuff. The outer tics also make me think javascript. I inserted the statement (with & without outer tics) but don't get an error message on the console. On Mon, Dec 30,

[go-nuts] Strip HTML comments before processing template

2024-12-30 Thread atilkan
Hi, I am trying to add html comment (yes, they will be removed). I believe it strips the comments after processing the template. If you put non-existing property inside html comments, it throws error. Maybe better to strip comments before processing the template? `` I would paste the whole err