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
|
||||
|
||||
// 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 <who>, one for me."
|
||||
// if <who> 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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user