tweaks and fmt
This commit is contained in:
parent
8922de6783
commit
8baf937ecf
2 changed files with 4 additions and 3 deletions
|
@ -5,6 +5,7 @@ bittorrent related things
|
|||
## ./bencode/
|
||||
|
||||
fork from code.google.com/p/bencode-go
|
||||
with a few changes
|
||||
|
||||
## ./torrent/
|
||||
|
||||
|
|
|
@ -28,14 +28,14 @@ func main() {
|
|||
continue
|
||||
}
|
||||
|
||||
buf, err := ioutil.ReadAll(fh)
|
||||
buf, err := ioutil.ReadAll(fh)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "%s\n", err)
|
||||
continue
|
||||
}
|
||||
fh.Close()
|
||||
|
||||
tf := torrent.File{}
|
||||
tf := torrent.File{}
|
||||
err = bencode.Unmarshal(buf, &tf)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "%s\n", err)
|
||||
|
@ -54,7 +54,7 @@ func main() {
|
|||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "%s\n", err)
|
||||
}
|
||||
_, err = fhOutput.Write(buf)
|
||||
_, err = fhOutput.Write(buf)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "%s\n", err)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue