fix example error (#53)
parent
dde6ad55c5
commit
d4658f22be
|
@ -22,3 +22,5 @@ _testmain.go
|
||||||
*.exe
|
*.exe
|
||||||
*.test
|
*.test
|
||||||
*.prof
|
*.prof
|
||||||
|
|
||||||
|
.idea
|
|
@ -39,7 +39,6 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
|
||||||
|
|
||||||
"github.com/klauspost/reedsolomon"
|
"github.com/klauspost/reedsolomon"
|
||||||
)
|
)
|
||||||
|
@ -88,10 +87,9 @@ func main() {
|
||||||
out := make([]io.Writer, len(shards))
|
out := make([]io.Writer, len(shards))
|
||||||
for i := range out {
|
for i := range out {
|
||||||
if shards[i] == nil {
|
if shards[i] == nil {
|
||||||
dir, _ := filepath.Split(fname)
|
|
||||||
outfn := fmt.Sprintf("%s.%d", fname, i)
|
outfn := fmt.Sprintf("%s.%d", fname, i)
|
||||||
fmt.Println("Creating", outfn)
|
fmt.Println("Creating", outfn)
|
||||||
out[i], err = os.Create(filepath.Join(dir, outfn))
|
out[i], err = os.Create(outfn)
|
||||||
checkErr(err)
|
checkErr(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue