package assert->expect
This commit is contained in:
parent
92f6209c5f
commit
a101ebb07e
|
@ -5,7 +5,7 @@ import (
|
|||
"io/ioutil"
|
||||
"strings"
|
||||
|
||||
"github.com/anacrolix/missinggo/assert"
|
||||
"github.com/anacrolix/missinggo/expect"
|
||||
|
||||
"github.com/anacrolix/torrent/bencode"
|
||||
"github.com/anacrolix/torrent/metainfo"
|
||||
|
@ -48,7 +48,7 @@ func (t *Torrent) Info(pieceLength int64) metainfo.Info {
|
|||
err := info.GeneratePieces(func(fi metainfo.FileInfo) (io.ReadCloser, error) {
|
||||
return ioutil.NopCloser(strings.NewReader(t.GetFile(strings.Join(fi.Path, "/")).Data)), nil
|
||||
})
|
||||
assert.Nil(err)
|
||||
expect.Nil(err)
|
||||
return info
|
||||
}
|
||||
|
||||
|
@ -56,6 +56,6 @@ func (t *Torrent) Metainfo(pieceLength int64) *metainfo.MetaInfo {
|
|||
mi := metainfo.MetaInfo{}
|
||||
var err error
|
||||
mi.InfoBytes, err = bencode.Marshal(t.Info(pieceLength))
|
||||
assert.Nil(err)
|
||||
expect.Nil(err)
|
||||
return &mi
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"github.com/anacrolix/missinggo/assert"
|
||||
"github.com/anacrolix/missinggo/expect"
|
||||
"github.com/boltdb/bolt"
|
||||
|
||||
"github.com/anacrolix/torrent/metainfo"
|
||||
|
@ -30,7 +30,7 @@ func NewBoltDB(filePath string) ClientImpl {
|
|||
db, err := bolt.Open(filepath.Join(filePath, "bolt.db"), 0600, &bolt.Options{
|
||||
Timeout: time.Second,
|
||||
})
|
||||
assert.Nil(err)
|
||||
expect.Nil(err)
|
||||
db.NoSync = true
|
||||
return &boltDBClient{db}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue