No developer worth his salary is writing PHP this way anymore, so I just can't understand why one would consider to do that with Go. Inline script tags are most of the time a very bad code smell. Unless you are extremely disciplined and use them only as a templating mechanism, which your library does not restrict at all, then it's not so bad. You're way better off using a templating engine.