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

Delta Between Two Patch Sets: src/pkg/debug/goobj/read.go

Issue 91840044: code review 91840044: all: spelling tweaks, A-G (Closed)
Left Patch Set: diff -r 96cbc91bc15a https://code.google.com/p/go Created 10 years, 11 months ago
Right Patch Set: diff -r 46ac9e6796a3 https://code.google.com/p/go Created 10 years, 11 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
« no previous file with change/comment | « src/pkg/debug/elf/elf.go ('k') | src/pkg/expvar/expvar.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2013 The Go Authors. All rights reserved. 1 // Copyright 2013 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 // Package goobj implements reading of Go object files and archives. 5 // Package goobj implements reading of Go object files and archives.
6 // 6 //
7 // TODO(rsc): Decide where this package should live. (golang.org/issue/6932) 7 // TODO(rsc): Decide where this package should live. (golang.org/issue/6932)
8 // TODO(rsc): Decide the appropriate integer types for various fields. 8 // TODO(rsc): Decide the appropriate integer types for various fields.
9 // TODO(rsc): Write tests. (File format still up in the air a little.) 9 // TODO(rsc): Write tests. (File format still up in the air a little.)
10 package goobj 10 package goobj
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 // 40:48 mode 503 // 40:48 mode
504 // 48:58 size 504 // 48:58 size
505 // 58:60 magic - `\n 505 // 58:60 magic - `\n
506 // We only care about name, size, and magic. 506 // We only care about name, size, and magic.
507 // The fields are space-padded on the right. 507 // The fields are space-padded on the right.
508 // The size is in decimal. 508 // The size is in decimal.
509 // The file data - size bytes - follows the header. 509 // The file data - size bytes - follows the header.
510 // Headers are 2-byte aligned, so if size is odd, an extra paddi ng 510 // Headers are 2-byte aligned, so if size is odd, an extra paddi ng
511 // byte sits between the file data and the next header. 511 // byte sits between the file data and the next header.
512 // The file data that follows is padded to an even number of byt es: 512 // The file data that follows is padded to an even number of byt es:
513 » » // if size is odd, an extra padding byte is inserted after the d ata. 513 » » // if size is odd, an extra padding byte is inserted betw the ne xt header.
514 if len(data) < 60 { 514 if len(data) < 60 {
515 return errTruncatedArchive 515 return errTruncatedArchive
516 } 516 }
517 if !bytes.Equal(data[58:60], archiveMagic) { 517 if !bytes.Equal(data[58:60], archiveMagic) {
518 return errCorruptArchive 518 return errCorruptArchive
519 } 519 }
520 name := trimSpace(data[0:16]) 520 name := trimSpace(data[0:16])
521 size, err := strconv.ParseInt(trimSpace(data[48:58]), 10, 64) 521 size, err := strconv.ParseInt(trimSpace(data[48:58]), 10, 64)
522 if err != nil { 522 if err != nil {
523 return errCorruptArchive 523 return errCorruptArchive
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 } 655 }
656 } 656 }
657 657
658 r.readFull(r.tmp[:7]) 658 r.readFull(r.tmp[:7])
659 if !bytes.Equal(r.tmp[:7], []byte("\xffgo13ld")) { 659 if !bytes.Equal(r.tmp[:7], []byte("\xffgo13ld")) {
660 return r.error(errCorruptObject) 660 return r.error(errCorruptObject)
661 } 661 }
662 662
663 return nil 663 return nil
664 } 664 }
LEFTRIGHT

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