From 788e7fd40c1318043e64be336e610d739a0c43cc Mon Sep 17 00:00:00 2001 From: Olivier Tremblay Date: Fri, 20 Oct 2017 19:06:24 -0400 Subject: [PATCH 1/2] Fix godeps Previous one didn't contain appropriate subpackage deps Do note that the jklfs deps are experimental, probably break this out in its own repo eventually. --- Godeps/Godeps.json | 39 +++++++++++++++++++++++++++++++++++++-- cmd/jklfs/jklfile.go | 6 +++++- 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index c1fa090..238baad 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -1,12 +1,47 @@ { - "ImportPath": "github.com/avanier/jkl", - "GoVersion": "go1.8", + "ImportPath": "otremblay.com/jkl", + "GoVersion": "go1.9", "GodepVersion": "v79", + "Packages": [ + "./..." + ], "Deps": [ + { + "ImportPath": "github.com/hanwen/go-fuse/fuse", + "Comment": "v20170619-21-gcf21bc2", + "Rev": "cf21bc21cac77db799fff95d80e717908e6356a5" + }, + { + "ImportPath": "github.com/hanwen/go-fuse/fuse/nodefs", + "Comment": "v20170619-21-gcf21bc2", + "Rev": "cf21bc21cac77db799fff95d80e717908e6356a5" + }, + { + "ImportPath": "github.com/hanwen/go-fuse/fuse/pathfs", + "Comment": "v20170619-21-gcf21bc2", + "Rev": "cf21bc21cac77db799fff95d80e717908e6356a5" + }, + { + "ImportPath": "github.com/hanwen/go-fuse/splice", + "Comment": "v20170619-21-gcf21bc2", + "Rev": "cf21bc21cac77db799fff95d80e717908e6356a5" + }, { "ImportPath": "github.com/joho/godotenv", "Comment": "v1.1-23-gc9360df", "Rev": "c9360df4d16dc0e391ea2f28da2d31a9ede2e26f" + }, + { + "ImportPath": "golang.org/x/crypto/ssh/terminal", + "Rev": "541b9d50ad47e36efd8fb423e938e59ff1691f68" + }, + { + "ImportPath": "golang.org/x/sys/unix", + "Rev": "8dbc5d05d6edcc104950cc299a1ce6641235bc86" + }, + { + "ImportPath": "golang.org/x/sys/windows", + "Rev": "8dbc5d05d6edcc104950cc299a1ce6641235bc86" } ] } diff --git a/cmd/jklfs/jklfile.go b/cmd/jklfs/jklfile.go index ad5bbc3..e34d3fc 100644 --- a/cmd/jklfs/jklfile.go +++ b/cmd/jklfs/jklfile.go @@ -32,7 +32,7 @@ func (f *jklfile) String() string { func (f *jklfile) Write(data []byte, off int64) (uint32, fuse.Status) { n, err := f.File.WriteAt(data, off) if err != nil { - return uint32(0),fuse.EACCES + return uint32(0), fuse.EACCES } return uint32(n), fuse.OK } @@ -76,3 +76,7 @@ func (f *jklfile) SetInode(i *nodefs.Inode) {} func (f *jklfile) Utimens(atime *time.Time, mtime *time.Time) fuse.Status { return fuse.EPERM } + +func (f *jklfile) Flock(flags int) fuse.Status { + return fuse.ENOSYS +} From 78c07fde175055e30e5880e837dacf5a4309039c Mon Sep 17 00:00:00 2001 From: Olivier Tremblay Date: Fri, 20 Oct 2017 19:16:24 -0400 Subject: [PATCH 2/2] Fix unit tests --- cmd/jkl/editor_test.go | 2 +- jkl_test.go | 23 ----------------------- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/cmd/jkl/editor_test.go b/cmd/jkl/editor_test.go index 35aa64f..b9a9745 100644 --- a/cmd/jkl/editor_test.go +++ b/cmd/jkl/editor_test.go @@ -12,7 +12,7 @@ hell Issue Type: Sometype this is ignored Summary: Dookienator -also ignored`, "\n")) +also ignored`, "\n"), nil) AssertEqual(t, `Cowboys from hell`, iss.Fields.Description) diff --git a/jkl_test.go b/jkl_test.go index 70f796c..d1665bd 100644 --- a/jkl_test.go +++ b/jkl_test.go @@ -1,34 +1,11 @@ package jkl import ( - "encoding/json" - "fmt" "os" "testing" "text/template" ) -func TestUnmarshalProjects(t *testing.T) { - f, err := os.Open("projects.json") - if err != nil { - t.Error(err) - } - dec := json.NewDecoder(f) - x := struct{ Projects []Project }{} - - err = dec.Decode(&x) - if err != nil { - t.Error(err) - } - for _, p := range x.Projects { - for _, it := range p.IssueTypes { - for sn, f := range it.Fields { - fmt.Println(it.Name, sn, f.Name, f.Required, f.Schema.Type) - } - } - } -} - type TestType struct { Field string }