Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinetwigs committed May 30, 2022
1 parent e66cdb7 commit 55ce529
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/Vinetwigs/gobj

go 1.17
30 changes: 30 additions & 0 deletions gobj.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package gobj

import (
"bufio"
"os"
)

type Obj struct {
name string
}

func LoadObj(path string) (*Obj, error) {

f, err := os.OpenFile(path, os.O_RDONLY, 0644)

if err != nil {
return nil, err
}
return decodeFile(f)
}

func decodeFile(file *os.File) (*Obj, error) {
scanner := bufio.NewScanner(file)

for scanner.Scan() {
line := scanner.Text()
print(line)
}
return nil, nil
}

0 comments on commit 55ce529

Please sign in to comment.