aboutsummaryrefslogtreecommitdiff
path: root/parse.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2017-06-06 23:01:28 +0200
committerDimitri Sokolyuk <demon@dim13.org>2017-06-06 23:01:28 +0200
commit961bac0ffe07470eff3745085aa1cb9e37789d4d (patch)
treeab3494340e91135aff4d4e0816e4a6951e60a49b /parse.go
parentb23c0d91deff1a93d116314ad8143f073aa9a327 (diff)
Move ReadBin into cmd
Diffstat (limited to 'parse.go')
-rw-r--r--parse.go25
1 files changed, 1 insertions, 24 deletions
diff --git a/parse.go b/parse.go
index 1a768c6..97d1c24 100644
--- a/parse.go
+++ b/parse.go
@@ -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 {