Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1384)

Delta Between Two Patch Sets: 2014/go4java/runner/runner.go

Issue 111050043: code review 111050043: go.talks: add "Go for Javaneros" (Closed)
Left Patch Set: diff -r c636a8a8316f https://code.google.com/p/go.talks Created 9 years, 8 months ago
Right Patch Set: diff -r f10c43fe60f9 https://code.google.com/p/go.talks Created 9 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
LEFTRIGHT
(Both sides are equal)
1 // Package runner provides a Runner type that is used to define both RunCounter 1 // Package runner provides a Runner type that is used to define both RunCounter
2 // and EmbeddedRunCounter to show examples of how to use composition in Go. 2 // and EmbeddedRunCounter to show examples of how to use composition in Go.
3 package runner 3 package runner
4 4
5 import "fmt" 5 import "fmt"
6 6
7 // A Task is a simple task that prints a message when run. 7 // A Task is a simple task that prints a message when run.
8 type Task struct{ Msg string } 8 type Task struct{ Msg string }
9 9
10 func (t Task) Run() { 10 func (t Task) Run() {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 } 46 }
47 47
48 func (r *RunCounter) RunAll(ts []Task) { 48 func (r *RunCounter) RunAll(ts []Task) {
49 r.count += len(ts) 49 r.count += len(ts)
50 r.runner.RunAll(ts) // HL 50 r.runner.RunAll(ts) // HL
51 } 51 }
52 52
53 func (r *RunCounter) Count() int { return r.count } 53 func (r *RunCounter) Count() int { return r.count }
54 54
55 func (r *RunCounter) Name() string { return r.runner.Name() } 55 func (r *RunCounter) Name() string { return r.runner.Name() }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b