aboutsummaryrefslogtreecommitdiffstats
path: root/commands/webui.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-09-11 22:04:16 +0200
committerMichael Muré <batolettre@gmail.com>2018-09-11 22:14:46 +0200
commit3605887345792d2f981f971c6c4a2cb7f86a343e (patch)
treeafd525b6e3a638e4c619a5a986fcb2811c297444 /commands/webui.go
parent7b05983c19af4da70f2a9a5062913f4e4f5d5faa (diff)
downloadgit-bug-3605887345792d2f981f971c6c4a2cb7f86a343e.tar.gz
reorganize package for a more idomatic go
Diffstat (limited to 'commands/webui.go')
-rw-r--r--commands/webui.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/commands/webui.go b/commands/webui.go
index a2da8be7..66cc2a9d 100644
--- a/commands/webui.go
+++ b/commands/webui.go
@@ -14,7 +14,7 @@ import (
"github.com/MichaelMure/git-bug/graphql"
"github.com/MichaelMure/git-bug/repository"
- "github.com/MichaelMure/git-bug/util"
+ "github.com/MichaelMure/git-bug/util/git"
"github.com/MichaelMure/git-bug/webui"
"github.com/gorilla/mux"
"github.com/phayes/freeport"
@@ -111,7 +111,7 @@ func newGitFileHandler(repo repository.Repo) http.Handler {
}
func (gfh *gitFileHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
- hash := util.Hash(mux.Vars(r)["hash"])
+ hash := git.Hash(mux.Vars(r)["hash"])
if !hash.IsValid() {
http.Error(rw, "invalid git hash", http.StatusBadRequest)
@@ -122,7 +122,7 @@ func (gfh *gitFileHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
// This can be a problem for big files. There might be a way around
// that by implementing a io.ReadSeeker that would read and discard
// data when a seek is called.
- data, err := gfh.repo.ReadData(util.Hash(hash))
+ data, err := gfh.repo.ReadData(git.Hash(hash))
if err != nil {
http.Error(rw, err.Error(), http.StatusInternalServerError)
return