I believe this if serves no purpose and could be removed: if len(newcontent) == len(ct.Content()) { head := "<HEAD>" replace := []byte(fmt.Sprintf("%s\n\t%s", head, hugoGeneratorTag)) newcontent = bytes.Replace(ct.Content(), []byte(head), replace, 1) }
No, it serves a perfectly fine purpose, otherwise, it would have been long time removed.
We welcome new contributors and this is in general a very helpful crowd. But you ask some very basic questions that I feel is better suited for a more general developer forum, or maybe you should read some “Go programmers guides” or similar.