hello_world.go

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// This is a "stub" file.  It's a little start on your solution.
// It's not a complete solution though; you have to write some code.

// Package greeting should have a package comment that summarizes what it's about.
// https://golang.org/doc/effective_go.html#commentary
// While documentation is taken very seriously in Go, and tools like golint will
// complain if you don't include it, these comments are not required to make
// the test suite pass. It is up to you whether to include them in your submitted
// exercises.
// You can read more about the importance of documentation in Go here:
// https://blog.golang.org/godoc-documenting-go-code
package greeting

// testVersion identifies the version of the test program that you are
// writing your code to. If the test program changes in the future --
// after you have posted this code to the Exercism site -- reviewers
// will see that your code can't necessarily be expected to pass the
// current test suite because it was written to an earlier test version.
//
// This is a convention done for Exercism exercises in the Go language track,
// it is not a requirement of the Go programming language.
//
// This test versioning setup will be common to all the exercises in the
// Go language track. When crafting your own solution file from scratch you
// will be expected to add this constant or the initial test will fail.
// The version number you should use will be found in the constant
// "targetTestVersion" in the test file, see ./hello_test.go for more
// information.
const testVersion = 4

// HelloWorld should have a comment documenting it, beginning with the name of
// the function. It is recommended good practice, but, as we mention above, it's
// not necessary for making your solutions pass.
// https://github.com/golang/go/wiki/CodeReviewComments#comment-sentences
func HelloWorld() string {
	// Write some code here to pass the test suite.

	// When you have a working solution, REMOVE ALL THE STOCK COMMENTS.
	// They're here to help you get started but they only clutter a finished solution.
	// If you leave them in, reviewers will protest!
	return "Hello, World!"
}

Comments

Usually the next step is to have a conversation about your code and iterate on your solution.

In the case of hello world, however, we won't be encouraging conversations and iterations. We simply wanted to make sure you got through the (sometimes fiddly) process of fetching, running some tests, and submitting a solution to the site.

The next step is to fetch the next exercise (exercism fetch), create a solution, and then submit it to the website as a conversation starter.

Happy hacking!


This is an automated review based on lots and lots of real-life reviews. Read more about this experiment.

rikki- commented 12 May 2017 at 09:39 UTC

You're not logged in right now. Please login via GitHub to comment