Format codes by gofmt.

This commit is contained in:
mikespook 2011-05-24 13:20:22 +08:00
parent 82f0ab2cd5
commit 7a4bbcdc55
13 changed files with 219 additions and 213 deletions

3
README
View File

@ -16,6 +16,9 @@ It was implemented a native protocol for both worker and client API.
$ make client
$ ./client
- Code format
gofmt -spaces=true -tabwidth=4 -w=true -tabindent=false $(DIR)
----
xingxing<mikespook@gmail.com>
http://mikespook.com

View File

@ -16,3 +16,6 @@ include $(GOROOT)/src/Make.pkg
%: %.go
$(GC) $*.go
$(LD) -o $@ $*.$O
fmt:
gofmt -spaces=true -tabwidth=4 -w=true -tabindent=false ./

View File

@ -20,3 +20,6 @@ include $(GOROOT)/src/Make.pkg
%: install %.go
$(GC) $*.go
$(LD) -o $@ $*.$O
fmt:
gofmt -spaces=true -tabwidth=4 -w=true -tabindent=false ./

View File

@ -60,7 +60,7 @@ func (client *Client) read() (data []byte, err os.Error) {
buf := make([]byte, BUFFER_SIZE)
var n int
if n, err = client.conn.Read(buf); err != nil {
if (err == os.EOF && n == 0) {
if err == os.EOF && n == 0 {
break
}
return
@ -104,7 +104,7 @@ func (client *Client) ReadJob() (job *ClientJob, err os.Error) {
if job, err = DecodeClientJob(rel); err != nil {
return
} else {
switch(job.DataType) {
switch job.DataType {
case ERROR:
_, err = getError(job.Data)
return

View File

@ -39,4 +39,3 @@ func TestClientClose(t * testing.T) {
t.Error(err)
}
}

View File

@ -87,5 +87,3 @@ func (job * WorkerJob) UpdateStatus(numerator, denominator int) (err os.Error) {
result = append(result, d...)
return job.client.WriteJob(NewWorkerJob(REQ, WORK_STATUS, result))
}

View File

@ -90,7 +90,7 @@ func (client *jobClient) Work() {
client.worker.ErrQueue <- err
continue
} else {
switch(job.DataType) {
switch job.DataType {
case NOOP:
noop = true
case NO_JOB: