Wednesday, October 8, 2025
HomeGolangAre the variables handed to "html/template" handed by reference, by worth, or...

Are the variables handed to “html/template” handed by reference, by worth, or by the unique sort of the variable? – Getting Assist


I perceive that maps in Go are handed by reference, however what occurs if a 1GB map is a variable to execute a template with “html/template”?

Will one other 1GB copy be made in reminiscence earlier than executing it within the template? or will it’s handed by reference?

however what occurs if a 1GB map is a variable to execute a template with “html/template”?

I don’t fairly perceive this sentence. However, I assume what you meant is you go the map because the map to Execute perform. In that case, will probably be handed by reference, no copy wanted.

Sure, I used to be referring to the Execute perform. Thanks for the data.

Listed here are a couple of attention-grabbing articles:

So technically, the thought of a reference is perhaps incorrect however nonetheless, no copy of the underlying information is made.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments