我无法安装go包

时间:2014-09-22 20:08:59

标签: go package

我目前正在尝试安装https://github.com/willnorris/imageproxy。我是go lang的新手。所以我先安装go,github和hg。

我尝试了一些东西,克隆了git存储库,使用go get,使用go install,go build。 但没有任何效果,它可以将文件下载到src direcotry,但没有得到bin。

所以有人有想法吗?

--- ---编辑 有: 去获取github.com/willnorris/imageproxy/cmd/imageproxy

我得到:

[root@s17848415 go]# go get github.com/willnorris/imageproxy/cmd/imageproxy
# github.com/willnorris/imageproxy/cmd/imageproxy
src/github.com/willnorris/imageproxy/cmd/imageproxy/main.go:27: imported and not used: "github.com/sosedoff/imageproxy/proxy"
src/github.com/willnorris/imageproxy/cmd/imageproxy/main.go:60: undefined: imageproxy

- 编辑2 ---

[root@s17848415 go]# go get github.com/willnorris/imageproxy/cmd/imageproxy
package willnorris.com/go/imageproxy: unrecognized import path "willnorris.com/go/imageproxy"

2 个答案:

答案 0 :(得分:1)

溶液:

第一

go get github.com/willnorris/imageproxy/cmd/imageproxy

(下载来源)

第二 - 改变“vi github.com/willnorris/imageproxy/cmd/imageproxy” 最后一行

import (
     "flag"
     "fmt"
     "log"
     "net/http"
     "strings"

     "github.com/gregjones/httpcache"
     "github.com/gregjones/httpcache/diskcache"

     "github.com/willnorris/imageproxy"
 )

最后 - 再次:

  go get github.com/willnorris/imageproxy/cmd/imageproxy

答案 1 :(得分:1)

我已更新README文件以包含入门说明:https://github.com/willnorris/imageproxy#getting-started。值得注意的是,你应该得到“willnorris.com/go/imageproxy”,而不是“github.com/willnorris/imageproxy”。

相关问题