Giter Site home page Giter Site logo

cmd's Issues

panic: runtime error: slice bounds out of range

~ $ flying echo -n "%s \n %f %s %s %s %s %s"
[2014-10-07 11:45:50] [echo] panic: runtime error: slice bounds out of range

goroutine 20 [running]:
runtime.panic(0x4dbbc0, 0x58e16f)
    /home/rjeczalik/.gvm/gos/go1.3.1/src/pkg/runtime/panic.c:279 +0xf5
github.com/rjeczalik/tools/rw.(*PrefixedWriter).Write(0xc208062340, 0xc20807a000, 0x17, 0x8000, 0x17, 0x0, 0x0)
    /home/rjeczalik/src/github.com/rjeczalik/tools/rw/prefix.go:45 +0x615

Passing . for current directory does not work.

$ gotree ../fs
.
└── fs
    ├── fs.go
    ├── fsutil
    │   ├── fsutil.go
    │   ├── fsutil_test.go
    │   ├── tee.go
    │   └── tee_test.go
    ├── memfs
    │   ├── memfs.go
    │   ├── memfs_test.go
    │   ├── tree.go
    │   ├── tree_test.go
    │   ├── util.go
    │   └── util_test.go
    └── mktree

4 directories, 12 files
$ gotree .
.
$

fs/memfs: Create FS from tree command output

Unmarshal

.
├── out.gif
├── out.ogv
├── output2.gif
├── output3.gif
└── output.gif

into

var fs = FS{
    Tree: Directory{
        "out.gif": File{},
        "out.ogv": File{},
        "output2.gif": File{},
        "output.gif": File{},
    },
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.