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:
{{ `<!-- <input value='{{.nonExistingData}}'> -->` }}
{{ /* `<!-- <input value='{{.nonExistingData}}'> -->` */ }}
On Mon, Dec 30, 2024 at 10:34 PM Emrah ATILKAN <[email protected]>
wrote:
> 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 <[email protected]> wrote:
>
>> *"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, 2024 at 11:23 AM atilkan <[email protected]> wrote:
>>
>>> 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?
>>>
>>> `<!-- <input value='{{.nonExistingData}}'> -->`
>>>
>>> I would paste the whole error but you have to search needle in haystack.
>>> Basically says* "can't evaluate field nonExistingData"*.
>>>
>>>
>>> Have a nice day.
>>>
>>> --
>>> 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 [email protected].
>>
>>
>>> To view this discussion visit
>>> https://groups.google.com/d/msgid/golang-nuts/10547051-0324-4257-a81d-33644d92bca5n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/golang-nuts/10547051-0324-4257-a81d-33644d92bca5n%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 [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/golang-nuts/CAByJhJmn7%2BtdgvyUE1%2Bncq0ZzZvmnneM%2Bxj0kjvaa1NZT2GVCg%40mail.gmail.com.