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 Go Syntax Package Variables

Cristian Gerardo Hernandez Barrios
Cristian Gerardo Hernandez Barrios
28,382 Points

I'm not sure where is my problem

I fix the problem with the lowercase t of Total, because it's an import, but in the other file--- in sales.go i dont know what is the error...

I triy to change the equal sign to := but gives me an error.

Please help

src/code.my.com/git/sales/sales.go
package sales

var total = 1234.56
report.go
package main

import(
  "fmt"
  "code.my.com/git/sales"
)

func main() {
  fmt.Println(sales.Total)
}

2 Answers

Steven Parker
Steven Parker
229,982 Points

You must change the variable name in both places.

So you realized that names that begin with lower-case letters are not exported. But when you rename a variable, you need to change it where it is used and where it is defined.

It looks like you still need to change it in the sales package.

Hi Steven Parker ,
How you made an underline text using markdown (Just curious ? )?

Thanks,
Yuval Blass.

Joe Purdy
Joe Purdy
23,237 Points

You can create underlined text by surrounding a phrase in underscores like this: _Underlined Text_ -> Underlined Text

Steven Parker
Steven Parker
229,982 Points

Hi, yuvalblass. To underline a span, put a single underscore ("_") on either side.

So, for example: :point_right: _this sample_ :point_left: will become :point_right: this sample.

akhter ali
akhter ali
15,778 Points

As Steven Parker said, you must capitalize the first character of the variable/method you're exporting.