Hi.

I have found an unexpected behavior with the html/template package.
This is a sample program:
https://play.golang.org/p/Yh7UZJxQOd

It will print:

<!DOCTYPE html>
<html lang="en">
  <head>
    
<title>Test 2</title>

  </head>
  <body>
    <h1>Test</h1>
  </body>
</html>



However, suppose I want to "disable" the "head" template;
the reasonable solution is to define an empty "head" template in the 
associated template:
https://play.golang.org/p/yexg_Hxujq

However this prints:

<!DOCTYPE html>
<html lang="en">
  <head>
    
<title>Test 1</title>

  </head>
  <body>
    <h1>Test</h1>
  </body>
</html>


instead of the expected:

<!DOCTYPE html>
<html lang="en">
  <head>
    
  </head>
  <body>
    <h1>Test</h1>
  </body>
</html>


Is this a bug?


Thanks
Manlio

-- 
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.

Reply via email to