summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <ds@doozer.de>2016-11-17 19:23:00 +0100
committerDimitri Sokolyuk <ds@doozer.de>2016-11-17 19:23:00 +0100
commit3739ccc2f119a21b5760e48614c5fc3ec4684d1d (patch)
treec756f6d5bc173d7860b1fc19c7b21849e2711799
parent660916bbfacc31c15305d08b0fbc03d67d8426a2 (diff)
StringerHEADmaster
-rw-r--r--main.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/main.go b/main.go
index b734780..f656acc 100644
--- a/main.go
+++ b/main.go
@@ -5,8 +5,14 @@ import (
"os"
)
+type Len string
+
+func (l Len) String() string {
+ return fmt.Sprintf("%3d %s", len(l), string(l))
+}
+
func main() {
for _, a := range os.Args[1:] {
- fmt.Printf("%3d %v\n", len(a), a)
+ fmt.Println(Len(a))
}
}