dsnet / golib Goto Github PK
View Code? Open in Web Editor NEWCollection of mostly unrelated helper Go packages.
License: BSD 3-Clause "New" or "Revised" License
Collection of mostly unrelated helper Go packages.
License: BSD 3-Clause "New" or "Revised" License
I've been using try in scripts and really liking it.
However, I find A0, A1, etc to be fairly unintuitive. Particularly since in the kind of context in which I'm using try, I'm also tempted to dot import it. Then code reads:
A0(fn())
and the A0 is mysterious.
I'm on board for them being short. But maybe E for error? H for handle? X for "danger I might panic"? C for check?
Also, I'd like to request just "A" instead of "A0". :)
hi ! I'm using the ioutil.SectionWriter to write to files at different offset concurently,but runtime error:slice bounds out of range raised. I'm confused if I used the wrong way?the code I used is as follows:
sectionWriter:=ioutil.NewSectionWriter(file,offset,num)
_,err=io.Copy(sectionWriter,resp.Body)
the error is as follows:
panic: runtime error: slice bounds out of range
goroutine 20 [running]:
panic(0x80f5a0, 0xc82001a0e0)
/usr/lib/go-1.6/src/runtime/panic.go:481 +0x3e6
github.com/dsnet/golib/ioutil.(*SectionWriter).WriteAt(0xc820015a10, 0xc820130000, 0x8000, 0x8000, 0x80000000, 0xc82000b4c0, 0x0, 0x0)
/home/robin/cold-storage/clients/cmd_go_lang/csutil/src/github.com/dsnet/golib/ioutil/section_writer.go:41 +0x21a
github.com/dsnet/golib/ioutil.(*SectionWriter).Write(0xc820015a10, 0xc820130000, 0x8000, 0x8000, 0x8000, 0x0, 0x0)
/home/robin/cold-storage/clients/cmd_go_lang/csutil/src/github.com/dsnet/golib/ioutil/section_writer.go:27 +0x61
io.copyBuffer(0x7f88a4244ce8, 0xc820015a10, 0x7f88a41ff0b0, 0xc82000b500, 0xc820130000, 0x8000, 0x8000, 0x0, 0x0, 0x0)
/usr/lib/go-1.6/src/io/io.go:382 +0x2c9
io.Copy(0x7f88a4244ce8, 0xc820015a10, 0x7f88a41ff0b0, 0xc82000b500, 0xc82000b500, 0x0, 0x0)
/usr/lib/go-1.6/src/io/io.go:350 +0x64
During the debug,I find that when the error happens,the cnt is much larger than the length of data slice.But I don't know how to solve it !Am I using it the wrong way?
Sometimes it's useful to have also Close() function in memfile. I needed it when I worked with https://github.com/faiface/beep
Just something simple like this:
func (fb *File) Close() error { return nil }
Can you please add it?
Repos are cheap, and try is useful. :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.