diff --git a/go/two-fer/two_fer.go b/go/two-fer/two_fer.go index c23982e..989a6f9 100644 --- a/go/two-fer/two_fer.go +++ b/go/two-fer/two_fer.go @@ -1,15 +1,13 @@ -// 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 twofer should have a package comment that summarizes what it's about. -// https://golang.org/doc/effective_go.html#commentary package twofer -// ShareWith needs a comment documenting it. -func ShareWith(string) string { - // Write some code here to pass the test suite. - // Then 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 "" +import "fmt" + +// ShareWith just returns "One for , one for me." +// if is empty, use "you" +func ShareWith(who string) string { + ret := "One for %s, one for me." + if who == "" { + who = "you" + } + return fmt.Sprintf(ret, who) }