Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Go Language Go Language Overview Data Structures Creating slices

Its not working?!

It is telling me a return error but that is what the video showed us to do. What am I doing wrong??

src/elements/elements.go
package elements

import "fmt"

func NobleGases() {
    s := []string{}
  s = append(s, "He", "Ne", "Ar", "Kr", "Xe", "Rn")
  fmt.Println(s)
} 

3 Answers

Steven Parker
Steven Parker
229,732 Points

The instructions say to return the result. You won't need to print anything (or import "fmt").

I removed the fmt and print line, but still not passing.

Steven Parker
Steven Parker
229,732 Points

Did you also add a return statement (and put back the return type that was there originally)?

But of course not! That would be to easy..... :smh: