diff options
author | Dimitri Sokolyuk <demon@dim13.org> | 2017-06-06 23:01:28 +0200 |
---|---|---|
committer | Dimitri Sokolyuk <demon@dim13.org> | 2017-06-06 23:01:28 +0200 |
commit | 961bac0ffe07470eff3745085aa1cb9e37789d4d (patch) | |
tree | ab3494340e91135aff4d4e0816e4a6951e60a49b /parse.go | |
parent | b23c0d91deff1a93d116314ad8143f073aa9a327 (diff) |
Move ReadBin into cmd
Diffstat (limited to 'parse.go')
-rw-r--r-- | parse.go | 25 |
1 files changed, 1 insertions, 24 deletions
@@ -1,29 +1,6 @@ package j1 -import ( - "encoding/binary" - "fmt" - "os" -) - -// ReadBin file -func ReadBin(fname string) ([]uint16, error) { - fd, err := os.Open(fname) - if err != nil { - return nil, err - } - defer fd.Close() - stat, err := fd.Stat() - if err != nil { - return nil, err - } - size := stat.Size() - body := make([]uint16, int(size)/2) - if err := binary.Read(fd, binary.BigEndian, &body); err != nil { - return nil, err - } - return body, nil -} +import "fmt" // Decode instruction func Decode(v uint16) Instruction { |