Tadaweb interview question

Given the snippets of Go code, find errors and/or optimize the solution.