1) Change default gofmt default settings for
parsing and printing to new syntax.
Use -oldparser to parse the old syntax,
use -oldprinter to print the old syntax.
2) Change default gofmt formatting settings
to use tabs for indentation only and to use
spaces for alignment. This will make the code
alignment insensitive to an editor's tabwidth.
Use -spaces=false to use tabs for alignment.
3) Manually changed src/exp/parser/parser_test.go
so that it doesn't try to parse the parser's
source files using the old syntax (they have
new syntax now).
4) gofmt -w src misc test/bench
5th and last set of files.
R=rsc
CC=golang-dev
https://golang.org/cl/180050
diff --git a/src/pkg/time/tick.go b/src/pkg/time/tick.go
index cd247d3..a37e8ea 100644
--- a/src/pkg/time/tick.go
+++ b/src/pkg/time/tick.go
@@ -23,19 +23,19 @@
// A Ticker holds a synchronous channel that delivers `ticks' of a clock
// at intervals.
type Ticker struct {
- C <-chan int64; // The channel on which the ticks are delivered.
- ns int64;
- shutdown bool;
+ C <-chan int64 // The channel on which the ticks are delivered.
+ ns int64
+ shutdown bool
}
// Stop turns off a ticker. After Stop, no more ticks will be delivered.
-func (t *Ticker) Stop() { t.shutdown = true }
+func (t *Ticker) Stop() { t.shutdown = true }
func (t *Ticker) ticker(c chan<- int64) {
- now := Nanoseconds();
- when := now;
+ now := Nanoseconds()
+ when := now
for !t.shutdown {
- when += t.ns; // next alarm
+ when += t.ns // next alarm
// if c <- now took too long, skip ahead
if when < now {
@@ -47,12 +47,12 @@
when += t.ns
}
- Sleep(when - now);
- now = Nanoseconds();
+ Sleep(when - now)
+ now = Nanoseconds()
if t.shutdown {
return
}
- c <- now;
+ c <- now
}
}
@@ -62,7 +62,7 @@
if ns <= 0 {
return nil
}
- return NewTicker(ns).C;
+ return NewTicker(ns).C
}
// Ticker returns a new Ticker containing a synchronous channel that will
@@ -72,8 +72,8 @@
if ns <= 0 {
return nil
}
- c := make(chan int64);
- t := &Ticker{c, ns, false};
- go t.ticker(c);
- return t;
+ c := make(chan int64)
+ t := &Ticker{c, ns, false}
+ go t.ticker(c)
+ return t
}