Format codes by gofmt.
This commit is contained in:
parent
82f0ab2cd5
commit
7a4bbcdc55
3
README
3
README
@ -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
|
||||
|
@ -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 ./
|
||||
|
@ -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 ./
|
||||
|
@ -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
|
||||
|
@ -39,4 +39,3 @@ func TestClientClose(t * testing.T) {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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))
|
||||
}
|
||||
|
||||
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user