Skip to content

Commit d1ac9e1

Browse files
committed
make format target fixed
1 parent d2daa8a commit d1ac9e1

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ include $(GOROOT)/src/Make.pkg
88
main: package
99
$(GC) -I_obj main.go
1010
$(LD) -L_obj -o $@ main.$O
11-
11+
1212
format:
1313
gofmt -spaces=true -tabindent=false -tabwidth=4 -w sphinx.go
14-
gofmt -spaces=true -tabindent=false -tabwidth=4 -w test.go
14+
gofmt -spaces=true -tabindent=false -tabwidth=4 -w main.go

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func main() {
1515
fmt.Println("Error: ", err)
1616
} else {
1717
for i := 0; i < len(status); i++ {
18-
fmt.Printf("%20s %s\n", status[i][0] + ":", status[i][1])
18+
fmt.Printf("%20s %s\n", status[i][0]+":", status[i][1])
1919
}
2020
}
2121
}

sphinx.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -262,26 +262,26 @@ func (client *Client) SetLimits(offset int, limit int, max int, cutoff int) *Cli
262262
func (self *Client) Status() ([][]string, os.Error) {
263263
body := make([]byte, 4)
264264
binary.BigEndian.PutUint32(body[0:4], 1)
265-
265+
266266
rest, err := self.simpleQuery(searchdCommandStatus, verCommandStatus, len(body), body)
267267
if err != nil {
268268
return nil, err
269269
}
270-
270+
271271
rows := binary.BigEndian.Uint32(rest[0:4])
272272
cols := binary.BigEndian.Uint32(rest[4:8])
273273
rest = rest[8:]
274-
274+
275275
response := make([][]string, rows)
276276
for i := 0; i < int(rows); i++ {
277277
response[i] = make([]string, cols)
278278
for j := 0; j < int(cols); j++ {
279279
len := binary.BigEndian.Uint32(rest[0:4])
280-
response[i][j] = bytes.NewBuffer(rest[4:4+len]).String()
280+
response[i][j] = bytes.NewBuffer(rest[4 : 4+len]).String()
281281
rest = rest[4+len:]
282282
}
283283
}
284-
284+
285285
return response, nil
286286
}
287287

@@ -307,7 +307,7 @@ func (self *Client) connect() (*net.TCPConn, os.Error) {
307307
return nil, err
308308
}
309309
my_proto := binary.BigEndian.Uint32(ver_bits[0:4])
310-
310+
311311
if my_proto < 1 {
312312
self.error = fmt.Sprintf("expected searchd protocol version 1+, got version %d", my_proto)
313313
return nil, SphinxError{os.ErrorString(self.error)}
@@ -321,18 +321,18 @@ func (self *Client) simpleQuery(command int, version int, size int, body []byte)
321321
return nil, err
322322
}
323323

324-
header := make([]byte, 8 + len(body))
324+
header := make([]byte, 8+len(body))
325325
binary.BigEndian.PutUint16(header[0:2], uint16(command))
326326
binary.BigEndian.PutUint16(header[2:4], uint16(version))
327327
binary.BigEndian.PutUint32(header[4:8], uint32(size))
328328

329-
request := bytes.Add(header, body);
329+
request := bytes.Add(header, body)
330330

331331
_, err = conn.Write(request)
332332
if err != nil {
333333
return nil, err
334334
}
335-
335+
336336
return self.getResponse(conn)
337337
}
338338

@@ -342,7 +342,7 @@ func (self *Client) getResponse(conn *net.TCPConn) ([]byte, os.Error) {
342342
// ver := binary.BigEndian.Uint16(size_bits[2:4])
343343
size := binary.BigEndian.Uint32(size_bits[4:8])
344344
rest, _ := ioutil.ReadAll(io.LimitReader(conn, int64(size)))
345-
345+
346346
switch status {
347347
case SearchdOk:
348348
case SearchdWarning:

0 commit comments

Comments
 (0)