# Small coding questions (code review)

**URL:** https://discourse.gohugo.io/t/small-coding-questions-code-review/5045
**Category:** support
**Created:** [January 6, 2017, 9:58pm UTC](https://discourse.gohugo.io/t/small-coding-questions-code-review/5045 "2017-01-06T21:58:00Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![magikstm](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/magikstm/32/2412_2.png) [@magikstm](https://discourse.gohugo.io/u/magikstm)
#### Post date: [January 6, 2017, 9:58pm UTC](https://discourse.gohugo.io/t/small-coding-questions-code-review/5045/1 "2017-01-06T21:58:00Z")

</div>

I’ll add some small questions in this thread. I’m debuting in Go and I’m learning from some projects as well as hugo.

Here: [https://github.com/spf13/hugo/blob/master/transform/hugogeneratorinject.go](https://github.com/spf13/hugo/blob/master/transform/hugogeneratorinject.go)

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) }`

---

<div class="post-metadata">

### Author: ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)
#### Post date: [January 6, 2017, 10:25pm UTC](https://discourse.gohugo.io/t/small-coding-questions-code-review/5045/2 "2017-01-06T22:25:38Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![magikstm](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/magikstm/32/2412_2.png) [@magikstm](https://discourse.gohugo.io/u/magikstm)
#### Post date: [January 6, 2017, 10:36pm UTC](https://discourse.gohugo.io/t/small-coding-questions-code-review/5045/3 "2017-01-06T22:36:21Z")

</div>

Thanks. I explored hugogeneratorinject\_test.go, ran it and I see what I missed.

There are still some concepts I don’t fully understand.

I’ll read more.
