Finished go/two-fer
This commit is contained in:
parent
169f72ca40
commit
612b12d1e0
@ -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
|
package twofer
|
||||||
|
|
||||||
// ShareWith needs a comment documenting it.
|
import "fmt"
|
||||||
func ShareWith(string) string {
|
|
||||||
// Write some code here to pass the test suite.
|
// ShareWith just returns "One for <who>, one for me."
|
||||||
// Then remove all the stock comments.
|
// if <who> is empty, use "you"
|
||||||
// They're here to help you get started but they only clutter a finished solution.
|
func ShareWith(who string) string {
|
||||||
// If you leave them in, reviewers will protest!
|
ret := "One for %s, one for me."
|
||||||
return ""
|
if who == "" {
|
||||||
|
who = "you"
|
||||||
|
}
|
||||||
|
return fmt.Sprintf(ret, who)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user